Spaces:
Sleeping
Sleeping
Pratik Dwivedi
commited on
Commit
·
a2cccdb
1
Parent(s):
4820173
model loading test
Browse files- app.py +27 -0
- requirements.txt +2 -0
app.py
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from llmware.prompts import Prompt
|
3 |
+
|
4 |
+
def register_gguf_model():
|
5 |
+
|
6 |
+
prompter = Prompt()
|
7 |
+
|
8 |
+
your_model_name = "my_model"
|
9 |
+
hf_repo_name = "TheBloke/Llama-2-7B-Chat-GGUF"
|
10 |
+
model_file = "llama-2-7b-chat.Q5_K_S.gguf"
|
11 |
+
print("registering model")
|
12 |
+
prompter.model_catalog.register_gguf_model(your_model_name,hf_repo_name, model_file, prompt_wrapper="open_chat")
|
13 |
+
print("loading model")
|
14 |
+
prompter.load_model(your_model_name)
|
15 |
+
|
16 |
+
return prompter
|
17 |
+
|
18 |
+
def main():
|
19 |
+
st.title("GGUF model loading test")
|
20 |
+
|
21 |
+
with st.spinner("Loading model..."):
|
22 |
+
prompter = register_gguf_model()
|
23 |
+
if prompter:
|
24 |
+
st.success("Model loaded!")
|
25 |
+
|
26 |
+
if __name__ == "__main__":
|
27 |
+
main()
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
llmware
|
2 |
+
streamlit
|