Spaces:
Sleeping
Sleeping
import os | |
import requests | |
import torch | |
#from typing import Optional | |
from fastapi import FastAPI, Header, HTTPException, BackgroundTasks | |
from fastapi.responses import FileResponse | |
#from huggingface_hub.hf_api import HfApi | |
#from .models import config, WebhookPayload | |
#WEBHOOK_SECRET = os.getenv("WEBHOOK_SECRET") | |
#HF_ACCESS_TOKEN = os.getenv("HF_ACCESS_TOKEN") | |
#AUTOTRAIN_API_URL = "https://api.autotrain.huggingface.co" | |
#AUTOTRAIN_UI_URL = "https://ui.autotrain.huggingface.co" | |
app = FastAPI() | |
async def home(): | |
gpu = 'GPU not available' | |
if torch.cuda.is_available(): | |
gpu = 'GPU is available' | |
print("GPU is available") | |
else: | |
print("GPU is not available") | |
print('hello world') | |
print(os.getenv("foo")) | |
return {'success': True, 'response': 'hello world 3', 'gpu': gpu} |