Skip to content
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

Hugchat through python is not working #265

Open
Aravind4525 opened this issue Nov 4, 2024 · 1 comment
Open

Hugchat through python is not working #265

Aravind4525 opened this issue Nov 4, 2024 · 1 comment
Labels
bug bug!

Comments

@Aravind4525
Copy link

def code_compile_analysis(code, language, test_call):
# Ask a question to the current conversation with custom parameters
query_result = chatbot.chat(f"Compile and run the provided candidate's code \n {code} \n and language {language}. Compute the function with the given test_inputs {test_call}. If the code has any execution error, do not correct the error. Compute and Provide only if code has any error or not. Provide the Error Name in the key name as error if error is not there make as empty. Provide only in dictionary format not in the JSON Format.")

return query_result

Traceback (most recent call last):
File "C:\Users\ARAVIND\PycharmProjects\Code Evaluate\code_compile.py", line 162, in
result = pi_code_compile(code_submitted="https://chatlms.s3.ap-south-1.amazonaws.com/sum.py", language="python",
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ARAVIND\PycharmProjects\Code Evaluate\code_compile.py", line 152, in pi_code_compile
code_compile = code_compile_analysis(code=code, language=language, test_call=test_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ARAVIND\PycharmProjects\Code Evaluate\code_compile.py", line 99, in code_compile_analysis
query_result = chatbot.chat(f"Compile and run the provided candidate's code \n {code} \n and language {language}. Compute the function with the given test_inputs {test_call}. If the code has any execution error, do not correct the error. Compute and Provide only if code has any error or not. Provide the Error Name in the key name as error if error is not there make as empty. Provide only in dictionary format not in the JSON Format.")
^^^^^^^
NameError: name 'chatbot' is not defined

@Aravind4525 Aravind4525 added the bug bug! label Nov 4, 2024
@saleweaver
Copy link

From how the error looks, you simply forgot to initialize chatbot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bug!
Projects
None yet
Development

No branches or pull requests

2 participants