Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,11 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
from huggingface_hub import InferenceClient
|
3 |
|
4 |
"""
|
@@ -6,7 +13,7 @@ For more information on `huggingface_hub` Inference API support, please check th
|
|
6 |
"""
|
7 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
8 |
|
9 |
-
|
10 |
def respond(
|
11 |
message,
|
12 |
history: list[tuple[str, str]],
|
@@ -44,6 +51,7 @@ For information on how to customize the ChatInterface, peruse the gradio docs: h
|
|
44 |
"""
|
45 |
demo = gr.ChatInterface(
|
46 |
respond,
|
|
|
47 |
additional_inputs=[
|
48 |
gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
|
49 |
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
|
|
1 |
import gradio as gr
|
2 |
+
from threading import Thread
|
3 |
+
import re
|
4 |
+
import time
|
5 |
+
from PIL import Image
|
6 |
+
import torch
|
7 |
+
import spaces
|
8 |
+
|
9 |
from huggingface_hub import InferenceClient
|
10 |
|
11 |
"""
|
|
|
13 |
"""
|
14 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
15 |
|
16 |
+
@spaces.GPU
|
17 |
def respond(
|
18 |
message,
|
19 |
history: list[tuple[str, str]],
|
|
|
51 |
"""
|
52 |
demo = gr.ChatInterface(
|
53 |
respond,
|
54 |
+
title="Enlight Innovations Limited -- Demo",
|
55 |
additional_inputs=[
|
56 |
gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
|
57 |
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|