Commit
·
9929c3d
1
Parent(s):
1264fc9
update app.py
Browse files
app.py
CHANGED
|
@@ -24,17 +24,17 @@ model_id = "mistralai/Mistral-7B-v0.1"
|
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
-
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 28 |
-
model = AutoModelForCausalLM.from_pretrained(model_id)
|
| 29 |
|
| 30 |
# Create text generation pipeline
|
| 31 |
-
pipe = pipeline(model = model, tokenizer = tokenizer)
|
| 32 |
|
| 33 |
|
| 34 |
with st.form('my_form'):
|
| 35 |
question = st.text_area('Enter your question:', 'Tell me about attention mechanisms in a transformer?')
|
| 36 |
submitted = st.form_submit_button('Submit')
|
| 37 |
if submitted:
|
| 38 |
-
result = pipe(question, max_length=100)
|
| 39 |
st.write(question)
|
| 40 |
-
st.write(result[0]['generated_text'])
|
|
|
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
+
#tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 28 |
+
#model = AutoModelForCausalLM.from_pretrained(model_id)
|
| 29 |
|
| 30 |
# Create text generation pipeline
|
| 31 |
+
#pipe = pipeline(model = model, tokenizer = tokenizer)
|
| 32 |
|
| 33 |
|
| 34 |
with st.form('my_form'):
|
| 35 |
question = st.text_area('Enter your question:', 'Tell me about attention mechanisms in a transformer?')
|
| 36 |
submitted = st.form_submit_button('Submit')
|
| 37 |
if submitted:
|
| 38 |
+
#result = pipe(question, max_length=100)
|
| 39 |
st.write(question)
|
| 40 |
+
#st.write(result[0]['generated_text'])
|