Spaces:
Sleeping
Sleeping
Commit
·
868c45e
1
Parent(s):
30356d3
add model and space for user prompt
Browse files
app.py
CHANGED
|
@@ -1,4 +1,16 @@
|
|
| 1 |
import streamlit as st
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
from transformers import pipeline
|
| 3 |
+
from PIL import Image
|
| 4 |
|
| 5 |
+
arg_pipeline = pipeline(task="text-generation", model="austenem/Llama-2-7b-arg-quality")
|
| 6 |
+
|
| 7 |
+
st.title("Arg Quality Ranker")
|
| 8 |
+
st.write("Enter an argument and topic to analyze argument quality:")
|
| 9 |
+
|
| 10 |
+
user_argument = st.text_input("")
|
| 11 |
+
user_topic = st.text_input("")
|
| 12 |
+
|
| 13 |
+
if user_argument and user_topic:
|
| 14 |
+
user_input = f"Below is an argument and the topic it relates to. Please rate the quality of the argument on a scale of 0 to 1, where 0 is very poor and 1 is very good. \n ### Argument: {user_argument} \n ### Topic: {user_topic} \n ### Score: "
|
| 15 |
+
result = arg_pipeline(user_input)
|
| 16 |
+
st.write(result[0]["text"])
|