Arjun Singh
commited on
Commit
·
251eb32
1
Parent(s):
17ef741
Updating response parameters
Browse files
app.py
CHANGED
|
@@ -4,8 +4,8 @@ from huggingface_hub import InferenceClient
|
|
| 4 |
def chat_with_Zephyr(prompt, hugging_face_api_key):
|
| 5 |
model_name = "HuggingFaceH4/zephyr-7b-beta"
|
| 6 |
client = InferenceClient(model=model_name,token=hugging_face_api_key)
|
| 7 |
-
messages = [{"role": "user", "content": prompt}]
|
| 8 |
-
response = client.chat_completion(messages,max_tokens=
|
| 9 |
return response.choices[0].message.content
|
| 10 |
|
| 11 |
demo = gr.Interface(fn=chat_with_Zephyr, inputs=[gr.Textbox(label="Prompt"),gr.Textbox(label="Hugging Face API Key", type="password")],outputs="text")
|
|
|
|
| 4 |
def chat_with_Zephyr(prompt, hugging_face_api_key):
|
| 5 |
model_name = "HuggingFaceH4/zephyr-7b-beta"
|
| 6 |
client = InferenceClient(model=model_name,token=hugging_face_api_key)
|
| 7 |
+
messages = [{"role": "user", "content": prompt+' Your response should be complete, and not end abruptly.'}]
|
| 8 |
+
response = client.chat_completion(messages,max_tokens=150,temperature=0.7)
|
| 9 |
return response.choices[0].message.content
|
| 10 |
|
| 11 |
demo = gr.Interface(fn=chat_with_Zephyr, inputs=[gr.Textbox(label="Prompt"),gr.Textbox(label="Hugging Face API Key", type="password")],outputs="text")
|