Commit 
							
							·
						
						dcc9adb
	
1
								Parent(s):
							
							4d827ad
								
update
Browse files
    	
        app.py
    CHANGED
    
    | @@ -16,7 +16,6 @@ HF_API_KEY = os.environ["HF_TOKEN"] | |
| 16 | 
             
            BASE_URL = os.environ.get("BASE_URL", "https://api-inference.huggingface.co/v1/")
         | 
| 17 | 
             
            MODEL = os.environ.get("MODEL", "qwen2.5-coder:32b-instruct-q4_0")
         | 
| 18 |  | 
| 19 | 
            -
             | 
| 20 | 
             
            client = OpenAI(base_url=BASE_URL, api_key=HF_API_KEY)
         | 
| 21 |  | 
| 22 | 
             
            allowed_medias = [
         | 
| @@ -190,14 +189,14 @@ def update(files, prompt, top_p=1, temperature=1): | |
| 190 |  | 
| 191 | 
             
                files_info = get_files_infos(files)
         | 
| 192 | 
             
                # disable this if you're running the app locally or on your own server
         | 
| 193 | 
            -
                for file_info in files_info:
         | 
| 194 | 
            -
                    if file_info["type"] == "video":
         | 
| 195 | 
            -
                        if file_info["duration"] > 120:
         | 
| 196 | 
            -
                            raise gr.Error(
         | 
| 197 | 
            -
                                "Please make sure all videos are less than 2 minute long."
         | 
| 198 | 
            -
                            )
         | 
| 199 | 
            -
                    if file_info["size"] > 10000000:
         | 
| 200 | 
            -
                        raise gr.Error("Please make sure all files are less than 10MB in size.")
         | 
| 201 |  | 
| 202 | 
             
                attempts = 0
         | 
| 203 | 
             
                while attempts < 2:
         | 
|  | |
| 16 | 
             
            BASE_URL = os.environ.get("BASE_URL", "https://api-inference.huggingface.co/v1/")
         | 
| 17 | 
             
            MODEL = os.environ.get("MODEL", "qwen2.5-coder:32b-instruct-q4_0")
         | 
| 18 |  | 
|  | |
| 19 | 
             
            client = OpenAI(base_url=BASE_URL, api_key=HF_API_KEY)
         | 
| 20 |  | 
| 21 | 
             
            allowed_medias = [
         | 
|  | |
| 189 |  | 
| 190 | 
             
                files_info = get_files_infos(files)
         | 
| 191 | 
             
                # disable this if you're running the app locally or on your own server
         | 
| 192 | 
            +
            #    for file_info in files_info:
         | 
| 193 | 
            +
            #        if file_info["type"] == "video":
         | 
| 194 | 
            +
            #            if file_info["duration"] > 120:
         | 
| 195 | 
            +
            #                raise gr.Error(
         | 
| 196 | 
            +
            #                    "Please make sure all videos are less than 2 minute long."
         | 
| 197 | 
            +
            #                )
         | 
| 198 | 
            +
            #        if file_info["size"] > 10000000:
         | 
| 199 | 
            +
            #            raise gr.Error("Please make sure all files are less than 10MB in size.")
         | 
| 200 |  | 
| 201 | 
             
                attempts = 0
         | 
| 202 | 
             
                while attempts < 2:
         | 
 
			
