Update app.py
Browse files
app.py
CHANGED
@@ -11,6 +11,9 @@ os.environ['PYTORCH_CUDA_ALLOC_CONF'] = 'expandable_segments:True'
|
|
11 |
torch.cuda.empty_cache()
|
12 |
torch.cuda.set_per_process_memory_fraction(0.8) # Adjust the fraction as needed
|
13 |
|
|
|
|
|
|
|
14 |
# Load the model and tokenizer
|
15 |
model_name_or_path = "TheBloke/Wizard-Vicuna-7B-Uncensored-GPTQ"
|
16 |
conversations = {}
|
@@ -34,8 +37,6 @@ def load_model_norm():
|
|
34 |
|
35 |
model, tokenizer = load_model_norm()
|
36 |
|
37 |
-
# Initialize FastAPI application
|
38 |
-
app = FastAPI(root_path="/api/v1")
|
39 |
|
40 |
def generate_response(msg_prompt: str) -> dict:
|
41 |
"""
|
|
|
11 |
torch.cuda.empty_cache()
|
12 |
torch.cuda.set_per_process_memory_fraction(0.8) # Adjust the fraction as needed
|
13 |
|
14 |
+
# Initialize FastAPI application
|
15 |
+
app = FastAPI(root_path="/api/v1")
|
16 |
+
|
17 |
# Load the model and tokenizer
|
18 |
model_name_or_path = "TheBloke/Wizard-Vicuna-7B-Uncensored-GPTQ"
|
19 |
conversations = {}
|
|
|
37 |
|
38 |
model, tokenizer = load_model_norm()
|
39 |
|
|
|
|
|
40 |
|
41 |
def generate_response(msg_prompt: str) -> dict:
|
42 |
"""
|