hongming commited on
Commit
6d5c0f5
·
1 Parent(s): 7351cf1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -1
app.py CHANGED
@@ -1,4 +1,18 @@
1
  import streamlit as st
2
 
3
  x = st.slider('Select a value')
4
- st.write(x, 'squared is', x * x)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import streamlit as st
2
 
3
  x = st.slider('Select a value')
4
+ st.write(x, 'squared is', x * x)
5
+
6
+ print("hello")
7
+
8
+ import json
9
+ import requests
10
+ API_URL = "https://api-inference.huggingface.co/models/gpt2"
11
+ token = "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"
12
+ headers = {"Authorization": f"Bearer {token}"}
13
+ def query(payload):
14
+ data = json.dumps(payload)
15
+ response = requests.request("POST", API_URL, headers=headers, data=data)
16
+ return json.loads(response.content.decode("utf-8"))
17
+ data = query("Can you please let us know more details about your ")
18
+ print(data)