Spaces:
Sleeping
Sleeping
Commit
·
a50f59e
1
Parent(s):
c223424
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,23 +3,6 @@ import gradio as gr
|
|
| 3 |
|
| 4 |
client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
|
| 5 |
|
| 6 |
-
def my_inference_function(name):
|
| 7 |
-
return "Hello " + name + "!"
|
| 8 |
-
|
| 9 |
-
gradio_interface = gr.Interface(
|
| 10 |
-
fn=my_inference_function,
|
| 11 |
-
inputs="text",
|
| 12 |
-
outputs="text",
|
| 13 |
-
examples=[
|
| 14 |
-
["Jill"],
|
| 15 |
-
["Sam"]
|
| 16 |
-
],
|
| 17 |
-
title="REST API with Gradio and Huggingface Spaces",
|
| 18 |
-
description="This is a demo of how to build an AI powered REST API with Gradio and Huggingface Spaces – for free! Based on [this article](https://www.tomsoderlund.com/ai/building-ai-powered-rest-api). See the **Use via API** link at the bottom of this page.",
|
| 19 |
-
article="© Tom Söderlund 2022"
|
| 20 |
-
)
|
| 21 |
-
gradio_interface.launch()
|
| 22 |
-
|
| 23 |
def format_prompt(message, history):
|
| 24 |
prompt = "<s>"
|
| 25 |
for user_prompt, bot_response in history:
|
|
@@ -66,4 +49,4 @@ demo = gr.ChatInterface(fn=generate,
|
|
| 66 |
undo_btn=None
|
| 67 |
)
|
| 68 |
|
| 69 |
-
demo.queue().launch(show_api=
|
|
|
|
| 3 |
|
| 4 |
client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
|
| 5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
def format_prompt(message, history):
|
| 7 |
prompt = "<s>"
|
| 8 |
for user_prompt, bot_response in history:
|
|
|
|
| 49 |
undo_btn=None
|
| 50 |
)
|
| 51 |
|
| 52 |
+
demo.queue().launch(show_api=True)
|