Update app.py
Browse files
app.py
CHANGED
@@ -6,15 +6,12 @@ import torch
|
|
6 |
import optimum
|
7 |
from transformers import (AutoModelForCausalLM, AutoTokenizer, LlamaForCausalLM, LlamaTokenizer, GenerationConfig, pipeline,)
|
8 |
from fastapi.middleware.cors import CORSMiddleware
|
9 |
-
from pyngrok import ngrok
|
10 |
|
11 |
os.environ['PYTORCH_CUDA_ALLOC_CONF'] = 'expandable_segments:True'
|
12 |
torch.cuda.empty_cache()
|
13 |
torch.cuda.set_per_process_memory_fraction(0.8) # Adjust the fraction as needed
|
14 |
|
15 |
app = FastAPI(root_path="/api/v1")
|
16 |
-
ngrok_tunnel = ngrok.connect(7860)
|
17 |
-
print(ngrok_tunnel.public_url)
|
18 |
|
19 |
# Load the model and tokenizer
|
20 |
model_name_or_path = "TheBloke/Wizard-Vicuna-7B-Uncensored-GPTQ"
|
|
|
6 |
import optimum
|
7 |
from transformers import (AutoModelForCausalLM, AutoTokenizer, LlamaForCausalLM, LlamaTokenizer, GenerationConfig, pipeline,)
|
8 |
from fastapi.middleware.cors import CORSMiddleware
|
|
|
9 |
|
10 |
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 |
app = FastAPI(root_path="/api/v1")
|
|
|
|
|
15 |
|
16 |
# Load the model and tokenizer
|
17 |
model_name_or_path = "TheBloke/Wizard-Vicuna-7B-Uncensored-GPTQ"
|