Sathishkumartheta's picture
Update app.py
00dee95 verified
raw
history blame contribute delete
823 Bytes
import os
import getpass
from dotenv import load_dotenv
load_dotenv()
import subprocess
def write_nameserver_to_resolv_conf(nameserver):
"""Writes the specified nameserver to the /etc/resolv.conf file.
Args:
nameserver: The nameserver to write, e.g., "8.8.8.8".
"""
command = f"sudo echo 'nameserver {nameserver}' > /etc/resolv.conf"
subprocess.run(command, shell=True, check=True)
write_nameserver_to_resolv_conf("8.8.8.8")
write_nameserver_to_resolv_conf("8.8.4.4")
import telegram
import prompts
INTERFACE='TELEGRAM'
MODEL='LLAMA'
REPO_ID='meta-llama/Llama-3.2-1B-Instruct'
#REPO_ID='meta-llama/Llama-3.2-90B-Vision-Instruct'
if INTERFACE=='TELEGRAM':
telegram.init_telegram(model=MODEL,repo_id=REPO_ID)
telegram_bot=telegram.get_telegram_bot()
telegram_bot.infinity_polling()