Geraldine commited on
Commit
1acd7db
1 Parent(s): 2e04d93

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -7
app.py CHANGED
@@ -18,11 +18,7 @@ display_app_header()
18
  # UI sidebar parameters ####################################
19
  st.sidebar.header("Loging")
20
  if hg_token :=st.sidebar.text_input('Enter your HG token'):
21
- try:
22
- subprocess.check_call(["huggingface-cli", "login", "--token", hg_token])
23
- st.sidebar.info('Logged', icon="ℹ️")
24
- except subprocess.CalledProcessError:
25
- st.sidebar.error('Error with token, try again', icon="⚠️")
26
  else:
27
  st.sidebar.warning("enter your token")
28
 
@@ -200,9 +196,9 @@ if selected_task :
200
  response = None
201
  task = dict_hg_tasks[selected_task]
202
  if model:
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)
 
18
  # UI sidebar parameters ####################################
19
  st.sidebar.header("Loging")
20
  if hg_token :=st.sidebar.text_input('Enter your HG token'):
21
+ st.sidebar.info('Logged', icon="ℹ️")
 
 
 
 
22
  else:
23
  st.sidebar.warning("enter your token")
24
 
 
196
  response = None
197
  task = dict_hg_tasks[selected_task]
198
  if model:
199
+ client = InferenceClient(model=model,token=hg_token)
200
  else:
201
+ client = InferenceClient(token=hg_token)
202
  uploaded_input,text_input = display_inputs(task)
203
  prompt_input = display_prompt(task)
204
  context_input = display_context(task)