iishanbhandarii commited on
Commit
b10c6f5
1 Parent(s): e5298c4
Files changed (1) hide show
  1. app.py +19 -1
app.py CHANGED
@@ -1,4 +1,22 @@
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
+ 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
+