File size: 729 Bytes
5e52bf6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c4b0f88
 
 
 
 
ace6e0d
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import streamlit as st
from transformers import pipeline

st.set_page_config(
    page_title="LLAMA2",
    page_icon="🦙",
    layout="centered",
    initial_sidebar_state="expanded"
)

st.markdown(
    body = "# <center>FINE-TUNED LLAMA2 7B CHAT HF</center>",
    unsafe_allow_html = True
)
text="""4Bit QLoRA Fine-Tuned LLM on English Quotes Dataset."""

st.caption(text)

model_id = "iamsubrata/Llama-2-7b-chat-hf-sharded-bf16-fine-tuned"

LLM = pipeline(
    task = "text-generation",
    model = model_id
)

user_input = st.text_area(
    label = "Prompt...",
    value = "Tell me a joke."
)

button  = st.button(
    label = "Generate",
    key = "generate"
)

if user_input and button:
    st.write(LLM(str(user_input)))