-
Notifications
You must be signed in to change notification settings - Fork 313
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
I am new in python please provide me a code for using the chatbot I finish the training and I want to use it in discord how to use the training model? #46
Comments
I don't need discord bot code I just want the method for using Your script I have knowledge in other languages programing |
@medozeus here's a code you can addapt, mine is a simple terminal chatbot interface import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
from main import * # import the main python file with model from the example
import time
load_weights = tl.files.load_npz(name='saved/model.npz')
tl.files.assign_weights(load_weights, model_)
def respond(input):
sentence = inference(input, 3)
response=' '.join(sentence)
return response
while True:
userInput=input("user# ")
time.sleep(0.5)
print("bot# ",respond(userInput)) |
@carlitoselmago I copied and pasted your code into a file named "chatbot.py" with model.npz in a folder named "saved". chatbot.py and "main.py" are in the same folder.
|
@Radioactivebun0 that because there's some problem importing main.py file. try to add an empty file called __init__.py in the folder where both main.py and chatbot.py are located. |
@carlitoselmago I ran into the same error and I have created a |
I figured it out! |
No description provided.
The text was updated successfully, but these errors were encountered: