Spaces:
Sleeping
Sleeping
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -77,10 +77,8 @@ def generate_random_string(length):
|
|
77 |
return ''.join(random.choice(characters) for _ in range(length))
|
78 |
|
79 |
@spaces.GPU(duration=45)
|
80 |
-
def Piper(_do,
|
81 |
try:
|
82 |
-
neg = pipe.tokenizer(_dont)['input_ids']
|
83 |
-
print(neg)
|
84 |
retu = pipe_flx(
|
85 |
_do,
|
86 |
neg_prompt_ids=neg,
|
@@ -102,9 +100,11 @@ def infer(p1,p2):
|
|
102 |
_do.append(f'{p1}')
|
103 |
if p2 != "":
|
104 |
_dont = f'{p2} where in {p1}'
|
|
|
|
|
105 |
else:
|
106 |
-
|
107 |
-
output = Piper('A '+" ".join(_do),_dont)
|
108 |
if output == None:
|
109 |
return output
|
110 |
else:
|
|
|
77 |
return ''.join(random.choice(characters) for _ in range(length))
|
78 |
|
79 |
@spaces.GPU(duration=45)
|
80 |
+
def Piper(_do,neg):
|
81 |
try:
|
|
|
|
|
82 |
retu = pipe_flx(
|
83 |
_do,
|
84 |
neg_prompt_ids=neg,
|
|
|
100 |
_do.append(f'{p1}')
|
101 |
if p2 != "":
|
102 |
_dont = f'{p2} where in {p1}'
|
103 |
+
neg = pipe.tokenizer(_dont)['input_ids']
|
104 |
+
print(neg)
|
105 |
else:
|
106 |
+
neg = None
|
107 |
+
output = Piper('A '+" ".join(_do,neg),_dont)
|
108 |
if output == None:
|
109 |
return output
|
110 |
else:
|