File size: 855 Bytes
7d95e72
488b5be
7d95e72
d80d5e9
488b5be
 
 
e7dfe48
c03357d
488b5be
 
 
 
 
949d71e
232bff9
949d71e
 
 
 
 
 
488b5be
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import gradio as gr
from huggingface_hub import InferenceClient

client = InferenceClient(model="https://zgg3nzdpswxy4a-80.proxy.runpod.net/")

def inference(message, history):
    partial_message = ""
    for token in client.text_generation(message, max_new_tokens=128, stream=True):
        partial_message += token.replace("\###", "\##")
        yield partial_message

gr.ChatInterface(
    inference,
    chatbot=gr.Chatbot(height=300),
    textbox=gr.Textbox(placeholder="Please ask your question here...", container=False, scale=7),
    description="This is a chatbot trained on the Llama2-13b model.",
    title="SequoiaDB AI",
    examples=["What is SequioaDB?", "What is SequioaDB's license?", "What is SequioaDB's official website?"],
    retry_btn="Retry",
    undo_btn="Undo",
    clear_btn="Clear",
    submit_btn="Submit",
).queue().launch()