Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,8 +12,9 @@ print(f"CUDA device: {torch.cuda.get_device_name(torch.cuda.current_device())}")
|
|
| 12 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
| 13 |
"""
|
| 14 |
# client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
| 15 |
-
client = InferenceClient("deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B", token=os.getenv('deepseekv2'))
|
| 16 |
-
# client = InferenceClient("
|
|
|
|
| 17 |
|
| 18 |
|
| 19 |
@spaces.GPU(duration=13)
|
|
@@ -53,8 +54,14 @@ def respond(
|
|
| 53 |
"""
|
| 54 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
| 55 |
"""
|
|
|
|
|
|
|
|
|
|
| 56 |
demo = gr.ChatInterface(
|
| 57 |
-
respond,
|
|
|
|
|
|
|
|
|
|
| 58 |
additional_inputs=[
|
| 59 |
gr.Textbox(value="You are a friendly and helpful Chatbot, be concise and straight to the point, avoid excessive reasoning.", label="System message"),
|
| 60 |
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
|
@@ -69,6 +76,7 @@ demo = gr.ChatInterface(
|
|
| 69 |
],
|
| 70 |
)
|
| 71 |
|
|
|
|
| 72 |
|
| 73 |
if __name__ == "__main__":
|
| 74 |
demo.launch()
|
|
|
|
| 12 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
| 13 |
"""
|
| 14 |
# client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
| 15 |
+
# client = InferenceClient("deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B", token=os.getenv('deepseekv2'))
|
| 16 |
+
# client = InferenceClient("meta-llama/Meta-Llama-3-8B-Instruct", token=os.getenv('deepseekv2'))
|
| 17 |
+
client = InferenceClient("meta-llama/Llama-3.1-8B-Instruct", token=os.getenv('deepseekv2'))
|
| 18 |
|
| 19 |
|
| 20 |
@spaces.GPU(duration=13)
|
|
|
|
| 54 |
"""
|
| 55 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
| 56 |
"""
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
|
| 60 |
demo = gr.ChatInterface(
|
| 61 |
+
inputs = [respond, gr.Dropdown(["Qwen1.5", "Llama3-8b-Instruct", "Llama3.1-8b-Instruct"], label="Select Model"]
|
| 62 |
+
title = "Chatbot",
|
| 63 |
+
description = "Ask me anything!",
|
| 64 |
+
|
| 65 |
additional_inputs=[
|
| 66 |
gr.Textbox(value="You are a friendly and helpful Chatbot, be concise and straight to the point, avoid excessive reasoning.", label="System message"),
|
| 67 |
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
|
|
|
| 76 |
],
|
| 77 |
)
|
| 78 |
|
| 79 |
+
print(inputs[1])
|
| 80 |
|
| 81 |
if __name__ == "__main__":
|
| 82 |
demo.launch()
|