Upload folder using huggingface_hub
Browse files- README.md +5 -1
- app.py +18 -10
- benchmarking.ipynb +0 -0
- benchmarks/baseline.pkl +2 -2
- benchmarks/focused.pkl +2 -2
- benchmarks/succinct.pkl +2 -2
- samples/samples.pkl +2 -2
README.md
CHANGED
@@ -57,7 +57,11 @@ TBD
|
|
57 |
|
58 |
TBD
|
59 |
|
60 |
-
##
|
|
|
|
|
|
|
|
|
61 |
|
62 |
TBD
|
63 |
|
|
|
57 |
|
58 |
TBD
|
59 |
|
60 |
+
## Related Research
|
61 |
+
|
62 |
+
* [Retro: A Generalist Agent for Science](https://arxiv.org/abs/2112.04426)
|
63 |
+
* [RETRO-pytorch](https://github.com/lucidrains/RETRO-pytorch)
|
64 |
+
* [Why isn't Retro mainstream? State-of-the-art within reach](https://www.reddit.com/r/MachineLearning/comments/1cffgkt/d_why_isnt_retro_mainstream_stateoftheart_within/)
|
65 |
|
66 |
TBD
|
67 |
|
app.py
CHANGED
@@ -14,7 +14,10 @@ from transformers.agents import (
|
|
14 |
)
|
15 |
from tools.text_to_image import TextToImageTool
|
16 |
from transformers import load_tool
|
17 |
-
from prompts import
|
|
|
|
|
|
|
18 |
from pygments.formatters import HtmlFormatter
|
19 |
|
20 |
|
@@ -65,7 +68,7 @@ agent = get_agent(
|
|
65 |
model_name=model_name,
|
66 |
toolbox=TASK_SOLVING_TOOLBOX,
|
67 |
system_prompt=system_prompt,
|
68 |
-
use_openai=True,
|
69 |
)
|
70 |
|
71 |
app = None
|
@@ -130,10 +133,18 @@ def persist(component):
|
|
130 |
|
131 |
return component
|
132 |
|
|
|
133 |
from gradio.components import (
|
134 |
Component as GradioComponent,
|
135 |
)
|
136 |
-
from gradio.components.chatbot import
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
137 |
|
138 |
class CleanChatBot(Chatbot):
|
139 |
def __init__(self, **kwargs):
|
@@ -141,13 +152,9 @@ class CleanChatBot(Chatbot):
|
|
141 |
|
142 |
def _postprocess_content(
|
143 |
self,
|
144 |
-
chat_message:
|
145 |
-
|
146 |
-
|
147 |
-
| FileDataDict
|
148 |
-
| FileData
|
149 |
-
| GradioComponent
|
150 |
-
| None,
|
151 |
) -> str | FileMessage | ComponentMessage | None:
|
152 |
response = super()._postprocess_content(chat_message)
|
153 |
print(f"Post processing content: {response}")
|
@@ -156,6 +163,7 @@ class CleanChatBot(Chatbot):
|
|
156 |
response.props["open"] = False
|
157 |
return response
|
158 |
|
|
|
159 |
with gr.Blocks(
|
160 |
fill_height=True,
|
161 |
css=".gradio-container .message .content {text-align: left;}"
|
|
|
14 |
)
|
15 |
from tools.text_to_image import TextToImageTool
|
16 |
from transformers import load_tool
|
17 |
+
from prompts import (
|
18 |
+
DEFAULT_SQUAD_REACT_CODE_SYSTEM_PROMPT,
|
19 |
+
FOCUSED_SQUAD_REACT_CODE_SYSTEM_PROMPT,
|
20 |
+
)
|
21 |
from pygments.formatters import HtmlFormatter
|
22 |
|
23 |
|
|
|
68 |
model_name=model_name,
|
69 |
toolbox=TASK_SOLVING_TOOLBOX,
|
70 |
system_prompt=system_prompt,
|
71 |
+
use_openai=True, # Use OpenAI instead of a local or HF model as the base LLM engine
|
72 |
)
|
73 |
|
74 |
app = None
|
|
|
133 |
|
134 |
return component
|
135 |
|
136 |
+
|
137 |
from gradio.components import (
|
138 |
Component as GradioComponent,
|
139 |
)
|
140 |
+
from gradio.components.chatbot import (
|
141 |
+
Chatbot,
|
142 |
+
FileDataDict,
|
143 |
+
FileData,
|
144 |
+
ComponentMessage,
|
145 |
+
FileMessage,
|
146 |
+
)
|
147 |
+
|
148 |
|
149 |
class CleanChatBot(Chatbot):
|
150 |
def __init__(self, **kwargs):
|
|
|
152 |
|
153 |
def _postprocess_content(
|
154 |
self,
|
155 |
+
chat_message: (
|
156 |
+
str | tuple | list | FileDataDict | FileData | GradioComponent | None
|
157 |
+
),
|
|
|
|
|
|
|
|
|
158 |
) -> str | FileMessage | ComponentMessage | None:
|
159 |
response = super()._postprocess_content(chat_message)
|
160 |
print(f"Post processing content: {response}")
|
|
|
163 |
response.props["open"] = False
|
164 |
return response
|
165 |
|
166 |
+
|
167 |
with gr.Blocks(
|
168 |
fill_height=True,
|
169 |
css=".gradio-container .message .content {text-align: left;}"
|
benchmarking.ipynb
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
benchmarks/baseline.pkl
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c64b60b68e9352362580c572c05e65ca818f855da09b26a32c1c14036f061c4e
|
3 |
+
size 110471
|
benchmarks/focused.pkl
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:681d28d7a1dc27e565749c6efacc80dd0cb99800852181a6583d42d99c8ca597
|
3 |
+
size 105268
|
benchmarks/succinct.pkl
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8bc58d49f0f285305921c23635bb9e95fab00cd387c42632a65fa165d8a49a5b
|
3 |
+
size 105321
|
samples/samples.pkl
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2c48a2f60792b905f74b781ae80507acaf9f247e15fde5fbb8d196d12425b63a
|
3 |
+
size 99935
|