Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,17 @@
|
|
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 |
|
3 |
x = st.slider('Select a value')
|
4 |
+
st.write(x, 'squared is', x * x)
|
5 |
+
|
6 |
+
|
7 |
+
import requests
|
8 |
+
|
9 |
+
def query(payload, model_id, api_token):
|
10 |
+
headers = {"Authorization": f"Bearer {api_token}"}
|
11 |
+
API_URL = f"https://api-inference.huggingface.co/models/{model_id}"
|
12 |
+
response = requests.post(API_URL, headers=headers, json=payload)
|
13 |
+
return response.json()
|
14 |
+
|
15 |
+
model_id = "davidkim205/Rhea-72b-v0.5"
|
16 |
+
api_token = HF_TOKEN # get yours at hf.co/settings/tokens
|
17 |
+
data = query("Stel een plantaardig maaltijdplan op voor 1 dag", model_id, api_token)
|