Spaces:
Paused
Paused
Commit
·
b6934d2
1
Parent(s):
de1f6e0
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import
|
| 2 |
from transformers import AutoTokenizer, pipeline, logging
|
| 3 |
from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
|
| 4 |
|
|
@@ -36,4 +36,12 @@ pipe = pipeline(
|
|
| 36 |
repetition_penalty=1.15
|
| 37 |
)
|
| 38 |
|
| 39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
from transformers import AutoTokenizer, pipeline, logging
|
| 3 |
from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
|
| 4 |
|
|
|
|
| 36 |
repetition_penalty=1.15
|
| 37 |
)
|
| 38 |
|
| 39 |
+
user_input = st.text_input("Input a phrase")
|
| 40 |
+
|
| 41 |
+
prompt_template=f'''USER: {user_input}
|
| 42 |
+
ASSISTANT:'''
|
| 43 |
+
|
| 44 |
+
# Generate output when the "Generate" button is pressed
|
| 45 |
+
if st.button("Generate the prompt"):
|
| 46 |
+
output = pipe(prompt_template)[0]['generated_text']
|
| 47 |
+
st.text_area("Prompt", value=output)
|