Max KHANOV
commited on
Commit
•
6f51025
1
Parent(s):
ce06adf
Reorder?
Browse files
app.py
CHANGED
@@ -5,6 +5,12 @@ st.text('(Llama-7b sft)')
|
|
5 |
col1, col2 = st.columns([3,1])
|
6 |
|
7 |
example_num = st.selectbox("Select an example", ("None", "Example 1", "Example 2", "Example 3"), index=0)
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
with col1:
|
9 |
text = st.text_area('Enter text', "", height=180, key="text")
|
10 |
|
@@ -19,11 +25,6 @@ import requests
|
|
19 |
GROK_URL = "https://842f-128-105-19-70.ngrok-free.app"
|
20 |
ENDPOINT = f"{GROK_URL}/model"
|
21 |
|
22 |
-
if example_num != "None":
|
23 |
-
examples = {"Example 1": "What should you wear to a funeral?", "Example 2": "I need a good winter glove and I'm wondering what materials I should be looking for. I want something lightly insulated but weather resistant.", "Example 3": "My son is struggling to learn how to do addition. How can I teach him?"}
|
24 |
-
example_text = examples.get(example_num)
|
25 |
-
st.session_state.text = example_text
|
26 |
-
|
27 |
if trigger:
|
28 |
req = requests.get(ENDPOINT, params={"weight": weight, "k": k, "text": text, "ngrok-skip-browser-warning": "1"})
|
29 |
if req.status_code == 200:
|
|
|
5 |
col1, col2 = st.columns([3,1])
|
6 |
|
7 |
example_num = st.selectbox("Select an example", ("None", "Example 1", "Example 2", "Example 3"), index=0)
|
8 |
+
|
9 |
+
if example_num != "None":
|
10 |
+
examples = {"Example 1": "What should you wear to a funeral?", "Example 2": "I need a good winter glove and I'm wondering what materials I should be looking for. I want something lightly insulated but weather resistant.", "Example 3": "My son is struggling to learn how to do addition. How can I teach him?"}
|
11 |
+
example_text = examples.get(example_num)
|
12 |
+
st.session_state.text = example_text
|
13 |
+
|
14 |
with col1:
|
15 |
text = st.text_area('Enter text', "", height=180, key="text")
|
16 |
|
|
|
25 |
GROK_URL = "https://842f-128-105-19-70.ngrok-free.app"
|
26 |
ENDPOINT = f"{GROK_URL}/model"
|
27 |
|
|
|
|
|
|
|
|
|
|
|
28 |
if trigger:
|
29 |
req = requests.get(ENDPOINT, params={"weight": weight, "k": k, "text": text, "ngrok-skip-browser-warning": "1"})
|
30 |
if req.status_code == 200:
|