File size: 750 Bytes
f9b2e38 3738039 f9b2e38 3738039 f9b2e38 3738039 f9b2e38 3738039 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
import streamlit as st
st.header('Args')
st.text('(Llama-7b sft)')
col1, col2 = st.columns([3,1])
with col1:
text = st.text_area('Enter text', "", height=180)
with col2:
weight = st.slider('weight', min_value=0.0, max_value=3.0, value=1.5, step=0.01)
k = st.slider("k", min_value=2, max_value=10, value=10, step=1)
trigger = st.button("Generate")
st.subheader("Result")
import requests
GROK_URL = "https://edfa-128-105-19-70.ngrok-free.app"
ENDPOINT = f"{GROK_URL}/model"
if trigger:
req = requests.get(ENDPOINT, params={"weight": weight, "k": k, "text": text, "ngrok-skip-browser-warning": "1"})
if req.status_code == 200
result = req.text
else:
result = "Sorry, an error occured!"
st.write(result)
|