Spaces:
Runtime error
Runtime error
Upload with huggingface_hub
Browse files- app.py +19 -13
- bash.pmpt.tpl +1 -1
app.py
CHANGED
|
@@ -31,26 +31,32 @@ class BashPrompt(minichain.Prompt):
|
|
| 31 |
|
| 32 |
with minichain.start_chain("bash") as backend:
|
| 33 |
question = (
|
| 34 |
-
|
| 35 |
-
'and list the files in the directory"'
|
| 36 |
)
|
| 37 |
prompt = CLIPrompt(backend.OpenAI()).chain(BashPrompt(backend.BashProcess()))
|
| 38 |
-
result = prompt({"question": question})
|
| 39 |
-
print(result)
|
| 40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
# View the prompts.
|
| 42 |
|
| 43 |
# + tags=["hide_inp"]
|
| 44 |
-
CLIPrompt().show(
|
| 45 |
-
|
| 46 |
-
)
|
| 47 |
-
# -
|
| 48 |
|
| 49 |
|
| 50 |
-
# + tags=["hide_inp"]
|
| 51 |
-
BashPrompt().show(["ls", "cat file.txt"], "hello")
|
| 52 |
-
# -
|
| 53 |
|
| 54 |
-
# View the run log.
|
| 55 |
|
| 56 |
-
minichain.show_log("bash.log")
|
|
|
|
| 31 |
|
| 32 |
with minichain.start_chain("bash") as backend:
|
| 33 |
question = (
|
| 34 |
+
|
|
|
|
| 35 |
)
|
| 36 |
prompt = CLIPrompt(backend.OpenAI()).chain(BashPrompt(backend.BashProcess()))
|
|
|
|
|
|
|
| 37 |
|
| 38 |
+
|
| 39 |
+
prompt.to_gradio(fields =["question"],
|
| 40 |
+
examples=['Go up one directory, and then into the minichain directory,'
|
| 41 |
+
'and list the files in the directory'],
|
| 42 |
+
out_type="markdown"
|
| 43 |
+
|
| 44 |
+
).launch()
|
| 45 |
+
|
| 46 |
+
|
| 47 |
# View the prompts.
|
| 48 |
|
| 49 |
# + tags=["hide_inp"]
|
| 50 |
+
# CLIPrompt().show(
|
| 51 |
+
# {"question": "list the files in the directory"}, """```bash\nls\n```"""
|
| 52 |
+
# )
|
| 53 |
+
# # -
|
| 54 |
|
| 55 |
|
| 56 |
+
# # + tags=["hide_inp"]
|
| 57 |
+
# BashPrompt().show(["ls", "cat file.txt"], "hello")
|
| 58 |
+
# # -
|
| 59 |
|
| 60 |
+
# # View the run log.
|
| 61 |
|
| 62 |
+
# minichain.show_log("bash.log")
|
bash.pmpt.tpl
CHANGED
|
@@ -14,4 +14,4 @@ cp -r target/* myNewDirectory
|
|
| 14 |
|
| 15 |
That is the format. Begin!
|
| 16 |
|
| 17 |
-
Question: {{question}}
|
|
|
|
| 14 |
|
| 15 |
That is the format. Begin!
|
| 16 |
|
| 17 |
+
Question: "{{question}}"
|