Spaces:
Sleeping
Sleeping
Zai
commited on
Commit
Β·
045b8a9
1
Parent(s):
64fcb27
training config
Browse files- burmesegpt/__init__.py +1 -0
- burmesegpt/config.py +3 -0
- {burmese-gpt β burmesegpt}/data_prep.py +8 -1
- {burmese-gpt β burmesegpt}/main.py +7 -2
- {burmese-gpt β burmesegpt}/models.py +0 -0
- {burmese-gpt β burmesegpt}/tokenizer.py +0 -0
- {burmese-gpt β burmesegpt}/utils.py +0 -0
- interfaces/chat.py +0 -19
- interfaces/text-stream.py +0 -13
- sample.py +8 -1
- space.py +16 -0
- training.py +5 -1
burmesegpt/__init__.py
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
from .main import BurmeseGpt
|
burmesegpt/config.py
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
class Config:
|
2 |
+
def __init__(self) -> None:
|
3 |
+
pass
|
{burmese-gpt β burmesegpt}/data_prep.py
RENAMED
@@ -1,6 +1,13 @@
|
|
1 |
# to preps data
|
2 |
from datasets import load_dataset
|
3 |
-
|
4 |
|
5 |
dataset = load_dataset("")
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
# to preps data
|
2 |
from datasets import load_dataset
|
3 |
+
from torch.utils.data import Dataset
|
4 |
|
5 |
dataset = load_dataset("")
|
6 |
|
7 |
+
class Data(Dataset):
|
8 |
+
def __init__(self) -> None:
|
9 |
+
super().__init__()
|
10 |
+
|
11 |
+
def forward(self,x):
|
12 |
+
pass
|
13 |
+
|
{burmese-gpt β burmesegpt}/main.py
RENAMED
@@ -1,5 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
1 |
class BurmeseGpt:
|
2 |
-
def __init__(self)
|
3 |
pass
|
4 |
|
5 |
def train(self):
|
@@ -8,7 +13,7 @@ class BurmeseGpt:
|
|
8 |
def generate(self):
|
9 |
pass
|
10 |
|
11 |
-
def load_pretrained(self):
|
12 |
pass
|
13 |
|
14 |
|
|
|
1 |
+
from .models import SelfAttention,MLP,GPT
|
2 |
+
from .tokenizer import Tokenizer
|
3 |
+
from .config import Config
|
4 |
+
from .data_prep import Data
|
5 |
+
|
6 |
class BurmeseGpt:
|
7 |
+
def __init__(self):
|
8 |
pass
|
9 |
|
10 |
def train(self):
|
|
|
13 |
def generate(self):
|
14 |
pass
|
15 |
|
16 |
+
def load_pretrained(self,name=""):
|
17 |
pass
|
18 |
|
19 |
|
{burmese-gpt β burmesegpt}/models.py
RENAMED
File without changes
|
{burmese-gpt β burmesegpt}/tokenizer.py
RENAMED
File without changes
|
{burmese-gpt β burmesegpt}/utils.py
RENAMED
File without changes
|
interfaces/chat.py
DELETED
@@ -1,19 +0,0 @@
|
|
1 |
-
import streamlit as st
|
2 |
-
|
3 |
-
st.title("Burmese GPT")
|
4 |
-
|
5 |
-
if "messages" not in st.session_state:
|
6 |
-
st.session_state.messages = []
|
7 |
-
|
8 |
-
for message in st.session_state.messages:
|
9 |
-
with st.chat_message(message["role"]):
|
10 |
-
st.markdown(message["content"])
|
11 |
-
|
12 |
-
if prompt := st.chat_input("What is up?"):
|
13 |
-
st.chat_message("user").markdown(prompt)
|
14 |
-
st.session_state.messages.append({"role": "user", "content": prompt})
|
15 |
-
|
16 |
-
response = f"Echo: {prompt}"
|
17 |
-
with st.chat_message("assistant"):
|
18 |
-
st.markdown(response)
|
19 |
-
st.session_state.messages.append({"role": "assistant", "content": response})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
interfaces/text-stream.py
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
import streamlit as st
|
2 |
-
|
3 |
-
st.title("Burmese GPT")
|
4 |
-
|
5 |
-
user_input = st.text_area("Enter your text here:", "")
|
6 |
-
|
7 |
-
option = st.selectbox(
|
8 |
-
'Select an option:',
|
9 |
-
('Option 1', 'Option 2', 'Option 3')
|
10 |
-
)
|
11 |
-
|
12 |
-
if st.button("Generate"):
|
13 |
-
st.write("Generated text will appear here.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sample.py
CHANGED
@@ -1,3 +1,10 @@
|
|
1 |
# sample the texts
|
|
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
# sample the texts
|
2 |
+
from burmesegpt import BurmeseGpt
|
3 |
|
4 |
+
gpt = BurmeseGpt()
|
5 |
+
|
6 |
+
model_name = ''
|
7 |
+
|
8 |
+
gpt.load_pretrained(model_name)
|
9 |
+
|
10 |
+
gpt.sample()
|
space.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
|
3 |
+
def main():
|
4 |
+
st.title("Simply say Uwu xD")
|
5 |
+
|
6 |
+
video_source = st.sidebar.radio("Select feature:", ("Audio Generator", "Text Predictor",))
|
7 |
+
|
8 |
+
if video_source == "Audio Generator":
|
9 |
+
pass
|
10 |
+
|
11 |
+
else:
|
12 |
+
pass
|
13 |
+
|
14 |
+
|
15 |
+
if __name__ == "__main__":
|
16 |
+
main()
|
training.py
CHANGED
@@ -1,3 +1,7 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
2 |
|
3 |
out_dir = 'out'
|
|
|
1 |
+
from burmesegpt import BurmeseGpt
|
2 |
+
|
3 |
+
gpt = BurmeseGpt()
|
4 |
+
|
5 |
+
gpt.train()
|
6 |
|
7 |
out_dir = 'out'
|