andreska commited on
Commit
54bb289
·
verified ·
1 Parent(s): a3025ba

Second try

Browse files
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -4,19 +4,16 @@ from huggingface_hub import InferenceClient
4
 
5
  api_key = os.getenv("HF_API_KEY")
6
  client = InferenceClient(api_key=api_key)
7
- messages = [
8
- {
9
- "role": "user",
10
- "content": user_input
11
- }
12
- ]
13
  completion = client.chat.completions.create(
14
  model="Qwen/Qwen2.5-Coder-32B-Instruct",
15
  messages=messages,
16
  max_tokens=500
17
  )
18
 
19
- user_input = st.text_input('Ask me a question')
20
  if st.button("Submit"):
21
  if user_input:
22
  response = completion.choices[0].message
 
4
 
5
  api_key = os.getenv("HF_API_KEY")
6
  client = InferenceClient(api_key=api_key)
7
+
8
+ user_input = st.text_input('Ask me a question')
9
+ messages = [{"role": "user","content": user_input}]
10
+
 
 
11
  completion = client.chat.completions.create(
12
  model="Qwen/Qwen2.5-Coder-32B-Instruct",
13
  messages=messages,
14
  max_tokens=500
15
  )
16
 
 
17
  if st.button("Submit"):
18
  if user_input:
19
  response = completion.choices[0].message