File size: 569 Bytes
b279302
 
 
e923039
 
 
 
 
 
 
 
 
 
 
 
7b0afa7
1f3e15e
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import streamlit as st

x = st.slider('Select a value')
st.write(x, 'squared is', x * x)


import requests

def query(payload, model_id, api_token):
	headers = {"Authorization": f"Bearer {api_token}"}
	API_URL = f"https://api-inference.huggingface.co/models/{model_id}"
	response = requests.post(API_URL, headers=headers, json=payload)
	return response.json()

model_id = "davidkim205/Rhea-72b-v0.5"
api_token = st.secrets[HF_TOKEN] # get yours at hf.co/settings/tokens
data = query("Stel een plantaardig maaltijdplan op voor 1 dag", model_id, api_token)
st.write(data)