Geraldine commited on
Commit
91af3a6
·
verified ·
1 Parent(s): af4f7dd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -10
app.py CHANGED
@@ -169,14 +169,11 @@ with st.sidebar.expander("tasks documentation"):
169
 
170
  # functions ########################################
171
  cwd = os.getcwd()
172
- def get_input(upload,url,text):
173
  if upload is not None:
174
  return upload
175
- else:
176
- if url:
177
- return url
178
- elif text:
179
- return text
180
  return None
181
 
182
  def display_inputs(task):
@@ -206,12 +203,11 @@ if selected_task :
206
  client = InferenceClient(model=model)
207
  else:
208
  client = InferenceClient()
209
- uploaded_input,url_input,text_input = display_inputs(task)
210
  prompt_input = display_prompt(task)
211
  context_input = display_context(task)
212
- if get_input(uploaded_input,url_input,text_input):
213
- input = get_input(uploaded_input,url_input,text_input)
214
- st.write(input)
215
  response = getattr(client, task)(input)
216
  elif prompt_input:
217
  if context_input is not None:
 
169
 
170
  # functions ########################################
171
  cwd = os.getcwd()
172
+ def get_input(upload,text):
173
  if upload is not None:
174
  return upload
175
+ elif:
176
+ return text
 
 
 
177
  return None
178
 
179
  def display_inputs(task):
 
203
  client = InferenceClient(model=model)
204
  else:
205
  client = InferenceClient()
206
+ uploaded_input,text_input = display_inputs(task)
207
  prompt_input = display_prompt(task)
208
  context_input = display_context(task)
209
+ if get_input(uploaded_input,text_input):
210
+ input = get_input(uploaded_input,text_input)
 
211
  response = getattr(client, task)(input)
212
  elif prompt_input:
213
  if context_input is not None: