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