Spaces:
Runtime error
Runtime error
test
Browse files
app.py
CHANGED
@@ -1,4 +1,22 @@
|
|
1 |
import streamlit as st
|
|
|
2 |
|
3 |
x = st.slider('Select a value')
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
+
import os
|
3 |
|
4 |
x = st.slider('Select a value')
|
5 |
+
|
6 |
+
import requests
|
7 |
+
|
8 |
+
# Replace with your actual API token
|
9 |
+
api_token = os.getenv('huggingface')
|
10 |
+
headers = {"Authorization": f"Bearer {api_token}"}
|
11 |
+
|
12 |
+
# Replace 'gpt-3' with the model you want to use
|
13 |
+
api_url = "https://api-inference.huggingface.co/models/prometheus-eval/prometheus-7b-v2.0"
|
14 |
+
|
15 |
+
def query(payload):
|
16 |
+
response = requests.post(api_url, headers=headers, json=payload)
|
17 |
+
return response.json()
|
18 |
+
|
19 |
+
# Example usage
|
20 |
+
data = query({"inputs": "Once upon a time"})
|
21 |
+
st.write(data)
|
22 |
+
|