Holycanolies123
commited on
Commit
•
f7ef716
1
Parent(s):
2e31157
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import pipeline
|
2 |
+
|
3 |
+
bot = pipeline('text-generation', model='EleutherAI/gpt-neo-2.7B')
|
4 |
+
|
5 |
+
while True:
|
6 |
+
reply1 = "What is your question?"
|
7 |
+
print(reply1)
|
8 |
+
user_response = input()
|
9 |
+
reply2 = "What do you want the answer to be?"
|
10 |
+
print(reply2)
|
11 |
+
user_response = input()
|
12 |
+
reply3 = "That is the answer. As your intuition is simply what you want. What is your next question?"
|
13 |
+
|
14 |
+
# Generate bot response using Hugging Face's inference API
|
15 |
+
bot_response = bot(reply1 + "\n" + user_response + "\n" + reply2 + "\n" + user_response + "\n" + reply3, max_length=100)
|
16 |
+
print(bot_response[0]['generated_text'].split(reply1)[-1].split(reply2)[0].strip())
|
17 |
+
|