Spaces:
Sleeping
Sleeping
stevessschen
commited on
Commit
•
08546ec
1
Parent(s):
cf632f1
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
|
3 |
+
x = st.slider('Select a value')
|
4 |
+
st.wriet('steve test1')
|
5 |
+
st.write(x, 'squared is', x * x)
|
6 |
+
|
7 |
+
# Use a pipeline as a high-level helper
|
8 |
+
from transformers import pipeline
|
9 |
+
pipe = pipeline("text-generation", model="stevessschen/llama-2-7b-miniguanaco", tokenizer=tokenizer, max_length=200)
|
10 |
+
# Run text generation pipeline with our next model
|
11 |
+
prompt = "What is a large language model?"
|
12 |
+
#pipe = pipeline(task="text-generation", model=model, tokenizer=tokenizer, max_length=200)
|
13 |
+
result = pipe(f"<s>[INST] {prompt} [/INST]")
|
14 |
+
#print(result[0]['generated_text'])
|
15 |
+
st.wriet('steve test2')
|
16 |
+
st.write(result[0]['generated_text'])
|