-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Touseef docker #733
base: main
Are you sure you want to change the base?
Touseef docker #733
Conversation
src/smolagents/docker_executor.py
Outdated
stderr=False | ||
|
||
if stderr: | ||
raise ValueError(f"Code execution failed:\n{output}") | ||
else: | ||
if return_final_answer: | ||
while "---OUTPUT_END---" not in output: | ||
out, err = self.python_session.output # Get both streams | ||
if out: | ||
output += out.decode() | ||
if err: | ||
stderr += err.decode() | ||
|
||
# Load output for final answer or specific results | ||
with open('/tmp/smolagents/result.pkl', 'rb') as f: # Note path on host side | ||
result = pickle.load(f) | ||
else: | ||
result = None | ||
return result, execution_logs, return_final_answer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aymeric-roucher There is an undefined variable execution_logs
being referenced outside of any function and a chunk of code is also outside the function why is that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code is still not working, I'll ping you when it is!
@touseefahmed96 the main change that I'm doing it to make the code persistent (so can run two different executions of code a and b, with b using variables defined in a) + return any output from final answer (via pickling it). These requirements are quite challenging! |
@aymeric-roucher sure sounds good. |
Initialize the Docker-based Jupyter Kernel Gateway executor. | ||
""" | ||
self.logger = logger | ||
self.host = host |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't support Unix sockets?
No description provided.