Commit ·
e7ca75f
1
Parent(s): 1ac30bc
update app.py
Browse files27 unmodified lines28293031323334351 unmodified line3738394027 unmodified lines#model = AutoModelForCausalLM.from_pretrained(model_id)# Create text generation pipelinepipe = pipeline(model = model_id)with st.form('my_form'):question = st.text_area('Enter your question:', 'Tell me about attention mechanisms in a transformer?')1 unmodified lineif submitted:result = pipe(question, max_length=100)st.write(question)st.write(result[0]['generated_text'])27 unmodified lines28293031323334351 unmodified line3738394027 unmodified lines#model = AutoModelForCausalLM.from_pretrained(model_id)# Create text generation pipeline#pipe = pipeline(model = model_id)pipe = pipeline('text-generation')with st.form('my_form'):question = st.text_area('Enter your question:', 'Tell me about attention mechanisms in a transformer?')1 unmodified lineif submitted:result = pipe(question, max_length=100)st.write(question)st.write(result)
app.py+3-3