Spaces:
Runtime error
Runtime error
Upload with huggingface_hub
Browse files
app.py
CHANGED
@@ -19,27 +19,30 @@ class PyPrompt(minichain.Prompt):
|
|
19 |
# Chain the prompts.
|
20 |
|
21 |
with minichain.start_chain("pal") as backend:
|
22 |
-
question = "Melanie is a door-to-door saleswoman. She sold a third of her ' \
|
23 |
-
'vacuum cleaners at the green house, 2 more to the red house, and half of ' \
|
24 |
-
'what was left at the orange house. If Melanie has 5 vacuum cleaners left, ' \
|
25 |
-
'how many did she start with?'"
|
26 |
prompt = PalPrompt(backend.OpenAI()).chain(PyPrompt(backend.Python()))
|
27 |
-
result = prompt({"question": question})
|
28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
# View prompt examples.
|
31 |
|
32 |
-
# + tags=["hide_inp"]
|
33 |
-
PalPrompt().show(
|
34 |
-
|
35 |
-
|
36 |
-
)
|
37 |
-
# -
|
38 |
|
39 |
-
# + tags=["hide_inp"]
|
40 |
-
PyPrompt().show("def solution():\n\treturn 10 + 12", "22")
|
41 |
-
# -
|
42 |
|
43 |
-
# View the log.
|
44 |
|
45 |
-
minichain.show_log("pal.log")
|
|
|
19 |
# Chain the prompts.
|
20 |
|
21 |
with minichain.start_chain("pal") as backend:
|
|
|
|
|
|
|
|
|
22 |
prompt = PalPrompt(backend.OpenAI()).chain(PyPrompt(backend.Python()))
|
23 |
+
# result = prompt({"question": question})
|
24 |
+
|
25 |
+
question = "Melanie is a door-to-door saleswoman. She sold a third of her " \
|
26 |
+
"vacuum cleaners at the green house, 2 more to the red house, and half of " \
|
27 |
+
"what was left at the orange house. If Melanie has 5 vacuum cleaners left, " \
|
28 |
+
"how many did she start with?"
|
29 |
+
|
30 |
+
prompt.to_gradio(fields =["question"],
|
31 |
+
examples=[question]).launch()
|
32 |
|
33 |
# View prompt examples.
|
34 |
|
35 |
+
# # + tags=["hide_inp"]
|
36 |
+
# PalPrompt().show(
|
37 |
+
# {"question": "Joe has 10 cars and Bobby has 12. How many do they have together?"},
|
38 |
+
# "def solution():\n\treturn 10 + 12",
|
39 |
+
# )
|
40 |
+
# # -
|
41 |
|
42 |
+
# # + tags=["hide_inp"]
|
43 |
+
# PyPrompt().show("def solution():\n\treturn 10 + 12", "22")
|
44 |
+
# # -
|
45 |
|
46 |
+
# # View the log.
|
47 |
|
48 |
+
# minichain.show_log("pal.log")
|