Spaces:
Runtime error
Runtime error
Sanchit Gandhi
commited on
Commit
·
33669c4
1
Parent(s):
03410c0
Update app.py
Browse files
app.py
CHANGED
@@ -31,7 +31,7 @@ examples = [
|
|
31 |
64, "sampling", False],
|
32 |
['A poem about the beauty of science by Alfred Edgar Brittle\nTitle: The Magic Craft\nIn the old times', 64,
|
33 |
"sampling", False],
|
34 |
-
['استخراج العدد العاملي في لغة بايثون:', 64, "
|
35 |
["Pour déguster un ortolan, il faut tout d'abord", 64, "sampling", False],
|
36 |
[
|
37 |
'Traduce español de España a español de Argentina\nEl coche es rojo - el auto es rojo\nEl ordenador es nuevo - la computadora es nueva\nel boligrafo es negro -',
|
@@ -40,13 +40,13 @@ examples = [
|
|
40 |
'Estos ejemplos quitan vocales de las palabras\nEjemplos:\nhola - hl\nmanzana - mnzn\npapas - pps\nalacran - lcrn\npapa -',
|
41 |
64, "sampling", False],
|
42 |
["Question: If I put cheese into the fridge, will it melt?\nAnswer:", 64, "sampling", False],
|
43 |
-
["Math exercise - answers:\n34+10=44\n54+20=", 64, "
|
44 |
[
|
45 |
"Question: Where does the Greek Goddess Persephone spend half of the year when she is not with her mother?\nAnswer:",
|
46 |
-
64, "
|
47 |
[
|
48 |
"spelling test answers.\nWhat are the letters in « language »?\nAnswer: l-a-n-g-u-a-g-e\nWhat are the letters in « Romanian »?\nAnswer:",
|
49 |
-
64, "
|
50 |
]
|
51 |
|
52 |
|
@@ -69,7 +69,7 @@ def inference(input_sentence, max_length, sample_or_greedy, raw_text=False):
|
|
69 |
)
|
70 |
|
71 |
if raw_text:
|
72 |
-
return None, data['generated_text']
|
73 |
|
74 |
width, height = 3326, 3326
|
75 |
assets_path = "assets"
|
@@ -87,7 +87,7 @@ def inference(input_sentence, max_length, sample_or_greedy, raw_text=False):
|
|
87 |
BOX_COMP: "#120F25",
|
88 |
}
|
89 |
|
90 |
-
new_string = data['generated_text']
|
91 |
|
92 |
_, img = main(
|
93 |
input_sentence,
|
@@ -102,7 +102,7 @@ def inference(input_sentence, max_length, sample_or_greedy, raw_text=False):
|
|
102 |
init_font_size=150,
|
103 |
right_align=False,
|
104 |
)
|
105 |
-
return img, data['generated_text']
|
106 |
|
107 |
|
108 |
gr.Interface(
|
|
|
31 |
64, "sampling", False],
|
32 |
['A poem about the beauty of science by Alfred Edgar Brittle\nTitle: The Magic Craft\nIn the old times', 64,
|
33 |
"sampling", False],
|
34 |
+
['استخراج العدد العاملي في لغة بايثون:', 64, "sampling", False],
|
35 |
["Pour déguster un ortolan, il faut tout d'abord", 64, "sampling", False],
|
36 |
[
|
37 |
'Traduce español de España a español de Argentina\nEl coche es rojo - el auto es rojo\nEl ordenador es nuevo - la computadora es nueva\nel boligrafo es negro -',
|
|
|
40 |
'Estos ejemplos quitan vocales de las palabras\nEjemplos:\nhola - hl\nmanzana - mnzn\npapas - pps\nalacran - lcrn\npapa -',
|
41 |
64, "sampling", False],
|
42 |
["Question: If I put cheese into the fridge, will it melt?\nAnswer:", 64, "sampling", False],
|
43 |
+
["Math exercise - answers:\n34+10=44\n54+20=", 64, "sampling", False],
|
44 |
[
|
45 |
"Question: Where does the Greek Goddess Persephone spend half of the year when she is not with her mother?\nAnswer:",
|
46 |
+
64, "sampling", False],
|
47 |
[
|
48 |
"spelling test answers.\nWhat are the letters in « language »?\nAnswer: l-a-n-g-u-a-g-e\nWhat are the letters in « Romanian »?\nAnswer:",
|
49 |
+
64, "sampling", False]
|
50 |
]
|
51 |
|
52 |
|
|
|
69 |
)
|
70 |
|
71 |
if raw_text:
|
72 |
+
return None, data[0]['generated_text']
|
73 |
|
74 |
width, height = 3326, 3326
|
75 |
assets_path = "assets"
|
|
|
87 |
BOX_COMP: "#120F25",
|
88 |
}
|
89 |
|
90 |
+
new_string = data[0]['generated_text']
|
91 |
|
92 |
_, img = main(
|
93 |
input_sentence,
|
|
|
102 |
init_font_size=150,
|
103 |
right_align=False,
|
104 |
)
|
105 |
+
return img, data[0]['generated_text']
|
106 |
|
107 |
|
108 |
gr.Interface(
|