Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import textgrad as tg
|
| 3 |
+
|
| 4 |
+
tg.set_backward_engine("gpt-4o", override=True)
|
| 5 |
+
|
| 6 |
+
# Step 1: Get an initial response from an LLM.
|
| 7 |
+
model = tg.BlackboxLLM("gpt-4o")
|
| 8 |
+
question_string = ("If it takes 1 hour to dry 25 shirts under the sun, "
|
| 9 |
+
"how long will it take to dry 30 shirts under the sun? "
|
| 10 |
+
"Reason step by step")
|
| 11 |
+
|
| 12 |
+
question = tg.Variable(question_string,
|
| 13 |
+
role_description="question to the LLM",
|
| 14 |
+
requires_grad=False)
|
| 15 |
+
|
| 16 |
+
answer = model(question)
|
| 17 |
+
print(answer)
|