You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def run_model_question(question, model):
# Define the curl command
curl_command = f"curl http://localhost:11434/api/generate -d \"{{\\\"model\\\":\\\"{model}\\\", \\\"prompt\\\":\\\"{question}\\\"}}\""
print("Command: " + curl_command)
# Run the command and capture the output
output = subprocess.check_output(curl_command, shell=True, encoding='utf-8')
# Process the output as JSON and extract "response" values
responses = [json.loads(response)["response"] for response in output.strip().split('\n')]
# Create a JSON containing only "response" values
response_json = {'responses': responses}
return response_json
I had to change the strings, running on windows. In changing them, I did not realise it would get so complicated.
Great product, I like it! Thank You!
I am getting:
SyntaxError: Unexpected token '<', "
Models loaded, and not getting any other errors. Any ideas?
Thank You!
The text was updated successfully, but these errors were encountered: