try2 / app.py
stevessschen's picture
Update app.py
7d155ac
raw
history blame contribute delete
632 Bytes
import streamlit as st
x = st.slider('Select a value')
st.write('steve test1')
st.write(x, 'squared is', x * x)
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="stevessschen/llama-2-7b-miniguanaco", tokenizer=tokenizer, max_length=200)
# Run text generation pipeline with our next model
prompt = "What is a large language model?"
#pipe = pipeline(task="text-generation", model=model, tokenizer=tokenizer, max_length=200)
result = pipe(f"<s>[INST] {prompt} [/INST]")
#print(result[0]['generated_text'])
st.write('steve test2')
st.write(result[0]['generated_text'])