File size: 698 Bytes
db1c120
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
efb9434
 
bac1b5b
efb9434
 
 
 
 
f4fe9f6
7548e50
efb9434
db1c120
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
29
30
31
32
33
34
import os
import json
import requests

import gradio as gr

server_url = os.environ["SERVER_URL"]

def chat(message, history):
    data = {
        "message": message,
        "history": history
    }
    
    response = requests.post(
        server_url,
        json = data
    ).json()
    
    return response['response']

gradio_io = gr.ChatInterface(
    chat, title = "Ask questions about CSAIL research(er)!",
    examples = [
        "Who works on speech recognition?",
        "Who should I talk with about molecule generation?",
        "How are NLP and Robotics researchers collaborating?"
    ],
    autofocus = False,
    fill_height = False,
    undo_btn = None
)
gradio_io.launch()