Update app.py
Browse files
app.py
CHANGED
@@ -9,10 +9,14 @@ from huggingface_hub import InferenceClient
|
|
9 |
from jinja2 import Environment, FileSystemLoader
|
10 |
import numpy as np
|
11 |
from os import getenv
|
|
|
|
|
|
|
|
|
12 |
|
13 |
# Bhashini API translation function
|
14 |
-
api_key = '
|
15 |
-
user_id = '
|
16 |
|
17 |
def bhashini_translate(text: str, from_code: str = "en", to_code: str = "te") -> dict:
|
18 |
"""Translates text from source language to target language using the Bhashini API."""
|
@@ -167,7 +171,7 @@ with gr.Blocks(theme='NoCrypt/miku') as CHATBOT:
|
|
167 |
with gr.Column(scale=10):
|
168 |
gr.HTML(value="""<div style="color: #FF4500;"><h1>ADWITIYA-</h1> <h1><span style="color: #008000">Custom Manual Chatbot and Quizbot</span></h1></div>""")
|
169 |
gr.HTML(value=f"""<p style="font-family: sans-serif; font-size: 16px;">Using GenAI for CBIC Capacity Building - A free chat bot developed by National Customs Targeting Center using Open source LLMs for CBIC Officers</p>""")
|
170 |
-
gr.HTML(value=f"""<p style="font-family: Arial, sans-serif; font-size: 14px;">Developed by NCTC,Mumbai. Suggestions may be sent to <a href="mailto:[email protected]" style="color: #00008B; font-style: italic;">
|
171 |
|
172 |
with gr.Column(scale=3):
|
173 |
gr.Image(value='logo.png', height=200, width=200)
|
|
|
9 |
from jinja2 import Environment, FileSystemLoader
|
10 |
import numpy as np
|
11 |
from os import getenv
|
12 |
+
from backend.query_llm import generate_hf, generate_openai
|
13 |
+
from backend.semantic_search import table, retriever
|
14 |
+
from huggingface_hub import InferenceClient
|
15 |
+
|
16 |
|
17 |
# Bhashini API translation function
|
18 |
+
api_key = getenv('API_KEY')
|
19 |
+
user_id = getenv('USER_ID')
|
20 |
|
21 |
def bhashini_translate(text: str, from_code: str = "en", to_code: str = "te") -> dict:
|
22 |
"""Translates text from source language to target language using the Bhashini API."""
|
|
|
171 |
with gr.Column(scale=10):
|
172 |
gr.HTML(value="""<div style="color: #FF4500;"><h1>ADWITIYA-</h1> <h1><span style="color: #008000">Custom Manual Chatbot and Quizbot</span></h1></div>""")
|
173 |
gr.HTML(value=f"""<p style="font-family: sans-serif; font-size: 16px;">Using GenAI for CBIC Capacity Building - A free chat bot developed by National Customs Targeting Center using Open source LLMs for CBIC Officers</p>""")
|
174 |
+
gr.HTML(value=f"""<p style="font-family: Arial, sans-serif; font-size: 14px;">Developed by NCTC,Mumbai. Suggestions may be sent to <a href="mailto:[email protected]" style="color: #00008B; font-style: italic;">nctc-admin@gov.in</a>.</p>""")
|
175 |
|
176 |
with gr.Column(scale=3):
|
177 |
gr.Image(value='logo.png', height=200, width=200)
|