Spaces:
Sleeping
Sleeping
Create Ai-relationship.py
Browse files- Ai-relationship.py +15 -0
Ai-relationship.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from gpt4all import GPT4All
|
| 2 |
+
|
| 3 |
+
# Model File Path
|
| 4 |
+
model_path = "/data/data/com.termux/files/home/gpt4all_model.gguf"
|
| 5 |
+
|
| 6 |
+
# Load Model
|
| 7 |
+
model = GPT4All(model_path)
|
| 8 |
+
|
| 9 |
+
# Chat Function
|
| 10 |
+
while True:
|
| 11 |
+
user_input = input("You: ")
|
| 12 |
+
if user_input.lower() in ["exit", "quit"]:
|
| 13 |
+
break
|
| 14 |
+
response = model.chat(user_input)
|
| 15 |
+
print("AI:", response)
|