File size: 734 Bytes
f745223
e8fb838
1ffd977
 
e8fb838
 
f745223
 
 
 
 
 
 
 
1ffd977
 
 
 
f57923a
 
1ffd977
 
 
 
 
 
 
2334dc1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import os
import torch
import gradio as gr

from gen import get_pretrained_models, get_output, setup_model_parallel

os.environ["RANK"] = "0"
os.environ["WORKD_SIZE"] = "1"
os.environ["MASTER_ADDR"] = "127.0.0.1"
os.environ["MASTER_PORT"] = "50505"

# local_rank, world_size = setup_model_parallel()
# generator = get_pretrained_models("7B", "tokenizer")

def chat(user_input):
    bot_response = "hello world"
    response = ""
    for word in bot_response.split(" "):
        response += word + " "
        yield [(user_input, response)]

with gr.Blocks() as demo:
    chatbot = gr.Chatbot()
    textbox = gr.Textbox("Hello, how are you doing today?")

    textbox.submit(chat, textbox, chatbot)

demo.queue(api_open=False).launch()