Spaces:
Sleeping
Sleeping
Upload 3 files
Browse files- .gitattributes +1 -0
- MasherAI-7B-v3-GGUF-unsloth.Q4_K_M.gguf +3 -0
- app.py +39 -0
- requirements.txt +4 -0
.gitattributes
CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
MasherAI-7B-v3-GGUF-unsloth.Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
MasherAI-7B-v3-GGUF-unsloth.Q4_K_M.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:28b22e053ada8f628b3f29feaa9a33af328d6ccaebcd3ea908b509aac6cdd44c
|
3 |
+
size 4368450848
|
app.py
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
from huggingface_hub import hf_hub_download
|
3 |
+
import gradio as gr
|
4 |
+
from langchain.callbacks.manager import CallbackManager
|
5 |
+
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
|
6 |
+
from langchain_community.llms import LlamaCpp
|
7 |
+
|
8 |
+
|
9 |
+
model_path = "MasherAI-7B-v3-GGUF-unsloth.Q4_K_M.gguf"
|
10 |
+
|
11 |
+
def llm_load() -> LlamaCpp:
|
12 |
+
callback = CallbackManager([StreamingStdOutCallbackHandler()])
|
13 |
+
|
14 |
+
model = LlamaCpp(
|
15 |
+
model_path=model_path,
|
16 |
+
temperature=0.7,
|
17 |
+
max_tokens=2000,
|
18 |
+
top_p=1,
|
19 |
+
callback_manager=callback,
|
20 |
+
verbose=True
|
21 |
+
)
|
22 |
+
|
23 |
+
return model
|
24 |
+
|
25 |
+
llm = llm_load()
|
26 |
+
|
27 |
+
def generate_response(user_input):
|
28 |
+
model_prompt = f"<|im_start|>user\n{user_input}<|im_end|>\n<|im_start|>assistant\n"
|
29 |
+
response = llm(model_prompt)
|
30 |
+
return response
|
31 |
+
|
32 |
+
iface = gr.Interface(fn=generate_response, inputs="text", outputs="text",
|
33 |
+
title="MasherAI-7B Model",
|
34 |
+
description="A simple interface for interacting with the MasherAI-7B model.")
|
35 |
+
|
36 |
+
if __name__ == "__main__":
|
37 |
+
iface.launch()
|
38 |
+
|
39 |
+
|
requirements.txt
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
llama-cpp-python
|
2 |
+
huggingface_hub
|
3 |
+
langchain-community
|
4 |
+
langchain
|