llm_eval / app.py
iishanbhandarii's picture
test
b10c6f5 verified
raw
history blame contribute delete
No virus
549 Bytes
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)