Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -3,12 +3,20 @@ from huggingface_hub import InferenceClient
|
|
3 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
4 |
#import sqlite3
|
5 |
import json
|
|
|
|
|
|
|
6 |
|
7 |
"""
|
8 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
9 |
"""
|
10 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
11 |
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
def respond(
|
14 |
message,
|
|
|
3 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
4 |
#import sqlite3
|
5 |
import json
|
6 |
+
from db_setup import setup_database
|
7 |
+
#setup database
|
8 |
+
setup_database()
|
9 |
|
10 |
"""
|
11 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
12 |
"""
|
13 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
14 |
|
15 |
+
modelpath = "Salesforce/xLAM-1b-fc-r"
|
16 |
+
model = AutoModelForCausalLM.from_pretrained(modelpath, device_map="auto", torch_dtype="auto", trust_remote_code=True)
|
17 |
+
tokenizer = AutoTokenizer.from_pretrained(modelpath)
|
18 |
+
|
19 |
+
|
20 |
|
21 |
def respond(
|
22 |
message,
|