Spaces:
Sleeping
Sleeping
Commit
·
8a04515
1
Parent(s):
9af5885
update
Browse files
app.py
CHANGED
|
@@ -1,9 +1,23 @@
|
|
|
|
|
| 1 |
from gpt4all import GPT4All
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
model = GPT4All("wizardlm-13b-v1.1-superhot-8k.ggmlv3.q4_0.bin")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
if user_input.lower() == 'exit':
|
| 7 |
-
break
|
| 8 |
-
response = model.generate(user_input)
|
| 9 |
-
print("Chatbot:", response)
|
|
|
|
| 1 |
+
# app.py
|
| 2 |
from gpt4all import GPT4All
|
| 3 |
+
from flask import Flask, render_template, request
|
| 4 |
+
|
| 5 |
+
app = Flask(__name__)
|
| 6 |
+
|
| 7 |
model = GPT4All("wizardlm-13b-v1.1-superhot-8k.ggmlv3.q4_0.bin")
|
| 8 |
+
# Load your machine learning model
|
| 9 |
+
# model = joblib.load("wizardlm-13b-v1.1-superhot-8k.ggmlv3.q4_0.bin")
|
| 10 |
+
|
| 11 |
+
@app.route("/", methods=["GET", "POST"])
|
| 12 |
+
def index():
|
| 13 |
+
if request.method == "POST":
|
| 14 |
+
user_input = request.form["user_input"]
|
| 15 |
+
# Process the user input using your model
|
| 16 |
+
output = model.predict([user_input])[0]
|
| 17 |
+
|
| 18 |
+
return render_template("index.html", user_input=user_input, output=output)
|
| 19 |
+
|
| 20 |
+
return render_template("index.html")
|
| 21 |
|
| 22 |
+
if __name__ == "__main__":
|
| 23 |
+
app.run(debug=True)
|
|
|
|
|
|
|
|
|
|
|
|