Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -57,7 +57,7 @@ dict_hg_tasks = {
|
|
57 |
|
58 |
dict_hg_tasks_params = {
|
59 |
"automatic_speech_recognition": {
|
60 |
-
"input": "upload
|
61 |
"output": "text",
|
62 |
"prompt": False,
|
63 |
"context": False
|
@@ -69,19 +69,19 @@ dict_hg_tasks_params = {
|
|
69 |
"context": False
|
70 |
},
|
71 |
"image_classification": {
|
72 |
-
"input": "upload
|
73 |
"output": "image,text",
|
74 |
"prompt": False,
|
75 |
"context": False
|
76 |
},
|
77 |
"image_segmentation": {
|
78 |
-
"input": "upload
|
79 |
"output": "image,text",
|
80 |
"prompt": False,
|
81 |
"context": False
|
82 |
},
|
83 |
"object_detection": {
|
84 |
-
"input": "upload
|
85 |
"output": "image,text",
|
86 |
"prompt": False,
|
87 |
"context": False
|
@@ -93,13 +93,13 @@ dict_hg_tasks_params = {
|
|
93 |
"context": False
|
94 |
},
|
95 |
"visual_question_answering": {
|
96 |
-
"input": "upload
|
97 |
"output": "image,text",
|
98 |
"prompt": True,
|
99 |
"context": False
|
100 |
},
|
101 |
"image_to_image": {
|
102 |
-
"input": "upload
|
103 |
"output": "image,text",
|
104 |
"prompt": True,
|
105 |
"context": False
|
@@ -177,12 +177,12 @@ def get_input(upload,text):
|
|
177 |
return None
|
178 |
|
179 |
def display_inputs(task):
|
180 |
-
if dict_hg_tasks_params[task]["input"] == "upload
|
181 |
-
return st.file_uploader("Choose a file"),
|
182 |
elif dict_hg_tasks_params[task]["input"] == "text":
|
183 |
-
return None,
|
184 |
else:
|
185 |
-
return None,""
|
186 |
|
187 |
def display_prompt(task):
|
188 |
if dict_hg_tasks_params[task]["prompt"] is True:
|
|
|
57 |
|
58 |
dict_hg_tasks_params = {
|
59 |
"automatic_speech_recognition": {
|
60 |
+
"input": "upload",
|
61 |
"output": "text",
|
62 |
"prompt": False,
|
63 |
"context": False
|
|
|
69 |
"context": False
|
70 |
},
|
71 |
"image_classification": {
|
72 |
+
"input": "upload",
|
73 |
"output": "image,text",
|
74 |
"prompt": False,
|
75 |
"context": False
|
76 |
},
|
77 |
"image_segmentation": {
|
78 |
+
"input": "upload",
|
79 |
"output": "image,text",
|
80 |
"prompt": False,
|
81 |
"context": False
|
82 |
},
|
83 |
"object_detection": {
|
84 |
+
"input": "upload",
|
85 |
"output": "image,text",
|
86 |
"prompt": False,
|
87 |
"context": False
|
|
|
93 |
"context": False
|
94 |
},
|
95 |
"visual_question_answering": {
|
96 |
+
"input": "upload",
|
97 |
"output": "image,text",
|
98 |
"prompt": True,
|
99 |
"context": False
|
100 |
},
|
101 |
"image_to_image": {
|
102 |
+
"input": "upload",
|
103 |
"output": "image,text",
|
104 |
"prompt": True,
|
105 |
"context": False
|
|
|
177 |
return None
|
178 |
|
179 |
def display_inputs(task):
|
180 |
+
if dict_hg_tasks_params[task]["input"] == "upload":
|
181 |
+
return st.file_uploader("Choose a file"),""
|
182 |
elif dict_hg_tasks_params[task]["input"] == "text":
|
183 |
+
return None,st.text_input("Enter a text")
|
184 |
else:
|
185 |
+
return None,""
|
186 |
|
187 |
def display_prompt(task):
|
188 |
if dict_hg_tasks_params[task]["prompt"] is True:
|