Quantization-Attempts / tests /test_convertion.py
Rúben Almeida
Add exception handling for incompatible models
0735f93
raw
history blame
636 Bytes
import pytest
import requests
from environs import Env
from huggingface_hub import login
env = Env()
env.read_env(override=True)
@pytest.mark.parametrize("model_name", [
"gpt2",
])
def test_convert_download(model_name):
if env.str("HF_TOKEN"):
login(token=env("HF_TOKEN"))
response = requests.post(
env.str("ENDPOINT"),
json={
"hf_model_name": model_name,
"hf_tokenizer_name": model_name,
"hf_push_repo": None,
}
)
response.raise_for_status()
assert response.content_type == 'application/zip'
def test_convert_push():
pass