clarkchan commited on
Commit
d6c8def
·
1 Parent(s): 259c86a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -4,9 +4,10 @@ import requests
4
  #tokenizer = AutoTokenizer.from_pretrained("liam168/c2-roberta-base-finetuned-dianping-chinese")
5
  def chat(input):
6
  url = 'http://dark.21cnai.com:5000/api/chat'
7
- data = { 'message': input }
8
- headers = {'content-type': 'application/json','Authorization':'Bearer kdfjwoieskdflasdnf'}
9
- response = requests.post(url, data=data, headers=headers)
10
- return response
 
11
  iface = gr.Interface(fn=chat, inputs="text", outputs="text")
12
  iface.launch(server_name="0.0.0.0")
 
4
  #tokenizer = AutoTokenizer.from_pretrained("liam168/c2-roberta-base-finetuned-dianping-chinese")
5
  def chat(input):
6
  url = 'http://dark.21cnai.com:5000/api/chat'
7
+ data = { "message": input }
8
+ headers = {"Content-Type": "Application/json","Authorization":"Bearer kdfjwoieskdflasdnf"}
9
+ response = requests.post(url, json=data, headers=headers)
10
+ print(response)
11
+ return response.text
12
  iface = gr.Interface(fn=chat, inputs="text", outputs="text")
13
  iface.launch(server_name="0.0.0.0")