Spaces:
Sleeping
Sleeping
Commit
·
8de024a
1
Parent(s):
e62194e
update
Browse files
app.py
CHANGED
|
@@ -1,23 +1,20 @@
|
|
| 1 |
# app.py
|
| 2 |
from gpt4all import GPT4All
|
| 3 |
-
|
| 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 |
-
|
| 12 |
-
|
| 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 |
-
|
| 19 |
|
| 20 |
-
|
|
|
|
| 21 |
|
| 22 |
-
if
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# app.py
|
| 2 |
from gpt4all import GPT4All
|
| 3 |
+
import streamlit as st
|
| 4 |
|
|
|
|
|
|
|
|
|
|
| 5 |
# Load your machine learning model
|
|
|
|
| 6 |
|
| 7 |
+
model = GPT4All("wizardlm-13b-v1.1-superhot-8k.ggmlv3.q4_0.bin")
|
| 8 |
+
# model = joblib.load("model/your_model.pkl")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
+
st.title("Machine Learning Web App")
|
| 11 |
|
| 12 |
+
# Input for user's phrase
|
| 13 |
+
user_input = st.text_input("Enter a phrase:")
|
| 14 |
|
| 15 |
+
if user_input:
|
| 16 |
+
# Process the user input using your model when the user submits the form
|
| 17 |
+
if st.button("Submit"):
|
| 18 |
+
output = model.predict([user_input])[0]
|
| 19 |
+
st.write("You entered:", user_input)
|
| 20 |
+
st.write("Model output:", output)
|