Spaces:
Sleeping
Sleeping
test
Browse files- app.py +13 -0
- requirements.txt +5 -0
app.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import llama_cpp
|
| 3 |
+
|
| 4 |
+
llm = llama_cpp.Llama.from_pretrained(repo_id="KimChen/bge-m3-GGUF", filename="bge-m3-q4_k_m.gguf", embedding=True)
|
| 5 |
+
|
| 6 |
+
embeddings = llm.create_embedding("Hello, world!")
|
| 7 |
+
|
| 8 |
+
def greet(name):
|
| 9 |
+
embeddings = llm.create_embedding(name)
|
| 10 |
+
return "Hello " + name + "!!"
|
| 11 |
+
|
| 12 |
+
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
| 13 |
+
demo.launch(mcp_server=True)
|
requirements.txt
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
whoosh-reloaded==2.7.5
|
| 2 |
+
jieba==0.42.1
|
| 3 |
+
huggingface-hub
|
| 4 |
+
--extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
|
| 5 |
+
llama-cpp-python
|