Spaces:
Runtime error
Runtime error
Commit
·
4fece63
1
Parent(s):
a6b244e
- .gitignore +2 -1
- app.py +2 -13
.gitignore
CHANGED
@@ -1 +1,2 @@
|
|
1 |
-
secrets.py
|
|
|
|
1 |
+
secrets.py
|
2 |
+
.streamlit
|
app.py
CHANGED
@@ -1,20 +1,11 @@
|
|
1 |
import streamlit as st
|
2 |
-
from langchain_community.llms import Ollama
|
3 |
from transformers import pipeline
|
4 |
-
|
5 |
-
import os
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
# Log in with the token
|
10 |
-
login()
|
11 |
-
|
12 |
|
13 |
|
14 |
# Streamlit app title
|
15 |
st.title("Ollama LLaMA-2 Prompt Interface")
|
16 |
-
generator = pipeline('text-generation', model='meta-llama/Llama-2-7b-hf')
|
17 |
-
|
18 |
|
19 |
user_prompt = st.text_input("Enter your prompt:", "The first man on the moon was ...")
|
20 |
|
@@ -24,5 +15,3 @@ if st.button("Generate Response"):
|
|
24 |
# Display the result in the Streamlit app
|
25 |
st.write("Response:")
|
26 |
st.write(response)
|
27 |
-
|
28 |
-
|
|
|
1 |
import streamlit as st
|
|
|
2 |
from transformers import pipeline
|
3 |
+
import os
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
|
6 |
# Streamlit app title
|
7 |
st.title("Ollama LLaMA-2 Prompt Interface")
|
8 |
+
generator = pipeline('text-generation', model='meta-llama/Llama-2-7b-hf', use_auth_token=os.getenv("HF_TOKEN"))
|
|
|
9 |
|
10 |
user_prompt = st.text_input("Enter your prompt:", "The first man on the moon was ...")
|
11 |
|
|
|
15 |
# Display the result in the Streamlit app
|
16 |
st.write("Response:")
|
17 |
st.write(response)
|
|
|
|