Spaces:
Running
Running
RickMartel
commited on
Commit
•
d1fe01d
1
Parent(s):
b4d68ad
Update app.py
Browse files
app.py
CHANGED
@@ -2,15 +2,15 @@ import streamlit as st
|
|
2 |
from transformers import pipeline
|
3 |
|
4 |
pipe = pipeline(
|
5 |
-
"text-generation", model="RickMartel/
|
6 |
)
|
7 |
|
8 |
st.set_page_config(page_title="GPT2 4 Bible")
|
9 |
|
10 |
txt = st.text_area('Enter prompt of a biblical nature. WARNING: results will not be exact.')
|
11 |
-
txt = "<|startoftext|>" + txt
|
12 |
|
13 |
if txt and len(txt.strip()) > 0:
|
|
|
14 |
out = pipe(txt, num_return_sequences=1)[0]["generated_text"]
|
15 |
out = out.replace("<|startoftext|>", "")
|
16 |
with st.expander("Response", expanded=True):
|
|
|
2 |
from transformers import pipeline
|
3 |
|
4 |
pipe = pipeline(
|
5 |
+
"text-generation", model="RickMartel/GPT2_FT_By_NT_RAND_v5", device="cpu"
|
6 |
)
|
7 |
|
8 |
st.set_page_config(page_title="GPT2 4 Bible")
|
9 |
|
10 |
txt = st.text_area('Enter prompt of a biblical nature. WARNING: results will not be exact.')
|
|
|
11 |
|
12 |
if txt and len(txt.strip()) > 0:
|
13 |
+
txt = "<|startoftext|>" + txt
|
14 |
out = pipe(txt, num_return_sequences=1)[0]["generated_text"]
|
15 |
out = out.replace("<|startoftext|>", "")
|
16 |
with st.expander("Response", expanded=True):
|