Narchethan commited on
Commit
b8f5bef
·
1 Parent(s): e921c65

mise a jour

Browse files
Files changed (2) hide show
  1. app.py +2 -2
  2. requirements.txt +4 -0
app.py CHANGED
@@ -18,8 +18,8 @@ def openai_chat(api_key, system_prompt, user_prompt, temperature, max_tokens, to
18
  top_p=top_p,
19
  )
20
 
21
- # Extract the assistant's reply
22
- return response['choices'][0]['message']['content']
23
 
24
  except Exception as e:
25
  return f"Error: {str(e)}"
 
18
  top_p=top_p,
19
  )
20
 
21
+ # Extract the assistant's reply
22
+ return response.choices[0].message.content
23
 
24
  except Exception as e:
25
  return f"Error: {str(e)}"
requirements.txt CHANGED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ gradio
2
+ openai
3
+ requests
4
+ huggingface_hub