Spaces:
Runtime error
Runtime error
Commit
•
ccb40f9
1
Parent(s):
68df3ae
Comply with PyTorch format
Browse files
app.py
CHANGED
@@ -33,7 +33,6 @@ Options:
|
|
33 |
"""
|
34 |
|
35 |
API_URL = os.getenv("API_URL")
|
36 |
-
print(API_URL)
|
37 |
|
38 |
examples = [
|
39 |
['To do a "farduddle" means to jump up and down really fast. An example of a sentence that uses the word farduddle is:',
|
@@ -79,7 +78,7 @@ def inference(input_sentence, max_length, sample_or_greedy, raw_text=True):
|
|
79 |
)
|
80 |
|
81 |
if raw_text:
|
82 |
-
return None, data[0]['generated_text']
|
83 |
|
84 |
width, height = 3326, 3326
|
85 |
assets_path = "assets"
|
@@ -98,7 +97,7 @@ def inference(input_sentence, max_length, sample_or_greedy, raw_text=True):
|
|
98 |
}
|
99 |
|
100 |
# TODO: fix screenshot
|
101 |
-
new_string = data[0]['generated_text']
|
102 |
|
103 |
_, img = main(
|
104 |
input_sentence,
|
@@ -113,7 +112,7 @@ def inference(input_sentence, max_length, sample_or_greedy, raw_text=True):
|
|
113 |
init_font_size=142,
|
114 |
right_align=False,
|
115 |
)
|
116 |
-
return img, data[0]['generated_text']
|
117 |
|
118 |
|
119 |
gr.Interface(
|
|
|
33 |
"""
|
34 |
|
35 |
API_URL = os.getenv("API_URL")
|
|
|
36 |
|
37 |
examples = [
|
38 |
['To do a "farduddle" means to jump up and down really fast. An example of a sentence that uses the word farduddle is:',
|
|
|
78 |
)
|
79 |
|
80 |
if raw_text:
|
81 |
+
return None, data[0]['generated_text']
|
82 |
|
83 |
width, height = 3326, 3326
|
84 |
assets_path = "assets"
|
|
|
97 |
}
|
98 |
|
99 |
# TODO: fix screenshot
|
100 |
+
new_string = data[0]['generated_text'].split(input_sentence, 1)[1]
|
101 |
|
102 |
_, img = main(
|
103 |
input_sentence,
|
|
|
112 |
init_font_size=142,
|
113 |
right_align=False,
|
114 |
)
|
115 |
+
return img, data[0]['generated_text']
|
116 |
|
117 |
|
118 |
gr.Interface(
|