DeMaking commited on
Commit
6db4745
·
verified ·
1 Parent(s): f05dc68

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -14
app.py CHANGED
@@ -11,7 +11,6 @@ from huggingface_hub import login
11
  app = FastAPI()
12
 
13
  # Global variables
14
- TOKEN = os.getenv("TELEGRAM_BOT_TOKEN") # Telegram Token
15
  HF_HUB_TOKEN = os.getenv("HUGGINGFACEHUB_API_TOKEN")
16
 
17
 
@@ -21,19 +20,6 @@ if not HF_HUB_TOKEN:
21
  login(token=HF_HUB_TOKEN)
22
 
23
 
24
- # Verify Telegram token
25
- if not TOKEN:
26
- raise ValueError("Missing Telegram token. Please set TELEGRAM_BOT_TOKEN in environment variables.")
27
-
28
-
29
- try:
30
- response = httpx.get(f"https://api.telegram.org/bot{TOKEN}/getMe")
31
- print(f"Using TELEGRAM_TOKEN: {TOKEN[:5]}***") # Part of the token
32
- print(response.json())
33
- except httpx.RequestError as e:
34
- print(f"aaRequest failed: {e}")
35
-
36
-
37
  # Configure logging
38
  logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO)
39
  logger = logging.getLogger(__name__)
 
11
  app = FastAPI()
12
 
13
  # Global variables
 
14
  HF_HUB_TOKEN = os.getenv("HUGGINGFACEHUB_API_TOKEN")
15
 
16
 
 
20
  login(token=HF_HUB_TOKEN)
21
 
22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  # Configure logging
24
  logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO)
25
  logger = logging.getLogger(__name__)