Update app.py
Browse files
app.py
CHANGED
|
@@ -3,27 +3,6 @@ import qrcode
|
|
| 3 |
import qrcode.constants
|
| 4 |
from PIL import Image
|
| 5 |
|
| 6 |
-
# --------
|
| 7 |
-
|
| 8 |
-
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 9 |
-
import torch
|
| 10 |
-
|
| 11 |
-
model = AutoModelForCausalLM.from_pretrained(
|
| 12 |
-
'nineninesix/kani-tts-370m',
|
| 13 |
-
dtype=torch.bfloat16,
|
| 14 |
-
device_map='auto',
|
| 15 |
-
trust_remote_code=True # May be needed for some models
|
| 16 |
-
)
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
#--------
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
def get_qr_image(data: str, fill_color: str = None, back_color: str = None):
|
| 28 |
"""
|
| 29 |
Generate a QR code image from the given data and optional color parameters.
|
|
|
|
| 3 |
import qrcode.constants
|
| 4 |
from PIL import Image
|
| 5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
def get_qr_image(data: str, fill_color: str = None, back_color: str = None):
|
| 7 |
"""
|
| 8 |
Generate a QR code image from the given data and optional color parameters.
|