File size: 636 Bytes
0735f93
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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