DR-Rakshitha commited on
Commit
8de024a
·
1 Parent(s): e62194e
Files changed (1) hide show
  1. app.py +12 -15
app.py CHANGED
@@ -1,23 +1,20 @@
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)
 
 
 
 
 
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)