Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -409,7 +409,7 @@ def fetch_local_news():
|
|
409 |
api_key = os.environ['SERP_API']
|
410 |
url = f'https://serpapi.com/search.json?engine=google_news&q=birmingham headline&api_key={api_key}'
|
411 |
response = requests.get(url)
|
412 |
-
if response.status_code == 200:
|
413 |
results = response.json().get("news_results", [])
|
414 |
news_html = """
|
415 |
<h2 style="font-family: 'Georgia', serif; color: #ff0000; background-color: #f8f8f8; padding: 10px; border-radius: 10px;">Birmingham Today</h2>
|
@@ -490,7 +490,6 @@ model_id = 'openai/whisper-large-v3'
|
|
490 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
491 |
torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32
|
492 |
model = AutoModelForSpeechSeq2Seq.from_pretrained(model_id, torch_dtype=torch_dtype,
|
493 |
-
#low_cpu_mem_usage=True,
|
494 |
use_safetensors=True).to(device)
|
495 |
processor = AutoProcessor.from_pretrained(model_id)
|
496 |
|
|
|
409 |
api_key = os.environ['SERP_API']
|
410 |
url = f'https://serpapi.com/search.json?engine=google_news&q=birmingham headline&api_key={api_key}'
|
411 |
response = requests.get(url)
|
412 |
+
if response.status_code == 200):
|
413 |
results = response.json().get("news_results", [])
|
414 |
news_html = """
|
415 |
<h2 style="font-family: 'Georgia', serif; color: #ff0000; background-color: #f8f8f8; padding: 10px; border-radius: 10px;">Birmingham Today</h2>
|
|
|
490 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
491 |
torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32
|
492 |
model = AutoModelForSpeechSeq2Seq.from_pretrained(model_id, torch_dtype=torch_dtype,
|
|
|
493 |
use_safetensors=True).to(device)
|
494 |
processor = AutoProcessor.from_pretrained(model_id)
|
495 |
|