nyanko7 commited on
Commit
bc84695
1 Parent(s): 77a9bc5

fix: minor fix

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -5,6 +5,7 @@ import gradio as gr
5
  import numpy as np
6
  import torch
7
  import math
 
8
 
9
  from gradio import inputs
10
  from diffusers import (
@@ -342,7 +343,7 @@ def detect_text(text, state, width, height):
342
  item = item.strip()
343
  if item == "":
344
  continue
345
- if item in state:
346
  new_state[item] = {
347
  "map": state[item]["map"],
348
  "weight": state[item]["weight"],
 
5
  import numpy as np
6
  import torch
7
  import math
8
+ import re
9
 
10
  from gradio import inputs
11
  from diffusers import (
 
343
  item = item.strip()
344
  if item == "":
345
  continue
346
+ if state is not None and item in state:
347
  new_state[item] = {
348
  "map": state[item]["map"],
349
  "weight": state[item]["weight"],