Skip to content

Continue to run despite unsupported language #741

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

Closed
wants to merge 4 commits into from
Closed

Continue to run despite unsupported language #741

wants to merge 4 commits into from

Conversation

Notnaton
Copy link
Collaborator

@Notnaton Notnaton commented Nov 9, 2023

Describe the changes you have made:

Tries to not stop interpreter when using unsupported language.
Still not perfect, looking for testers and feedback.

Reference any relevant issue (Fixes #000)

https://discord.com/channels/1146610656779440188/1171921044496470106

  • I have performed a self-review of my code:

I have tested the code on the following OS:

  • Windows
  • MacOS
  • Linux

AI Language Model (if applicable)

  • GPT4
  • GPT3
  • Llama 7B
  • Llama 13B
  • Llama 34B
  • Huggingface model (Please specify which one)

}
)
break
yield {
"output": "continue if not finished. User declined to run the code"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The prompt here could be better, I am not good at this. This seems to work ok for 7B models

response = input(
" Would you like to run this code? (y/n)\n\n "
)
print("") # <- Aesthetic choice

if response.strip().lower() == "y":
interpreter.run_code_promt = True

if interpreter.run_code_promt:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is an unnecessary condition.

We can just set the property to true and follow the code path in this condition without needing to check the value of the property we just set.

Copy link
Collaborator Author

@Notnaton Notnaton Nov 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a second check in respond.py
We need to know if we run the code or not and disable the code_interpreter.
https://github.com/KillianLucas/open-interpreter/pull/741/files#diff-1f2d9ffe69c9b4ee7009e36234869f2a03f0af75f0bef3a1f5b8dac2acbd736eR149

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, for that we need to set the interpreter.run_code_promt (which I just noticed has a typo, can we make that interpreter.run_code_prompt), but we don’t need this if statement because at this point in the code that property can only have one value because we just set it a couple of lines above.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added it to stop it running the code regardless of y/n. It just didn't output the result when saying n.
I'll double check and come back to this after work 👍

@Notnaton Notnaton marked this pull request as draft November 10, 2023 19:52
@Notnaton
Copy link
Collaborator Author

See:
#745

Much better solution than my code

@Notnaton Notnaton closed this Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants