Max KHANOV commited on
Commit
f9b2e38
·
1 Parent(s): 2421454

Added interface

Browse files
Files changed (1) hide show
  1. app.py +22 -0
app.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+
3
+ st.header('Args')
4
+ st.text('(Llama-7b sft)')
5
+ col1, col2 = st.columns([3,1])
6
+ with col1:
7
+ text = st.text_area('Enter text', "", height=180)
8
+
9
+ with col2:
10
+ weight = st.slider('weight', 0.0, 1.5, 0.01)
11
+ k = st.slider("k", 2, 10, 1)
12
+
13
+ trigger = st.button("Generate")
14
+ st.subheader("Result")
15
+
16
+ import requests
17
+ GROK_URL = "https://f1dc-128-105-19-70.ngrok-free.app"
18
+ ENDPOINT = f"{GROK_URL}/model"
19
+
20
+ if trigger:
21
+ response = requests.get(ENDPOINT, params={"weight": weight, "k": k, "text": text, "ngrok-skip-browser-warning": "1"}).text
22
+ st.write(result)