Spaces:
Runtime error
Runtime error
Created main.py
Browse files
main.py
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from embedchain import App
|
| 2 |
+
from fastapi import FastAPI
|
| 3 |
+
from mangum import Mangum
|
| 4 |
+
from pydantic import BaseModel
|
| 5 |
+
import os
|
| 6 |
+
|
| 7 |
+
app = FastAPI()
|
| 8 |
+
handler = Mangum(app)
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
api_key = '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'
|
| 12 |
+
|
| 13 |
+
config = {
|
| 14 |
+
'llm': {
|
| 15 |
+
'provider': 'groq',
|
| 16 |
+
'config': {
|
| 17 |
+
'model':'llama3-70b-8192',
|
| 18 |
+
'top_p': 0.5,
|
| 19 |
+
'api_key': api_key,
|
| 20 |
+
'stream': True
|
| 21 |
+
}
|
| 22 |
+
},
|
| 23 |
+
'embedder': {
|
| 24 |
+
'provider': 'gpt4all',
|
| 25 |
+
}
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
swot_bot = App.from_config(config=config)
|
| 29 |
+
|
| 30 |
+
swot_bot.add("web_page","https://www.allen.ac.in/engineering/jee-main/tips-tricks/")
|
| 31 |
+
swot_bot.add("https://motion.ac.in/blog/jee-main-weightage-chapter-wise/")
|
| 32 |
+
swot_bot.add("https://www.allen.ac.in/engineering/jee-main/preparation-strategy/")
|
| 33 |
+
swot_bot.add("https://byjus.com/jee/how-to-prepare-for-jee-at-home/")
|
| 34 |
+
swot_bot.add("https://www.askiitians.com/iit-jee/how-to-prepare-for-iit-jee-from-class-11.html")
|
| 35 |
+
swot_bot.add("https://byjus.com/jee/complete-study-plan-to-crack-jee-main/")
|
| 36 |
+
#swot_bot.add("https://mystudycart.com/iit-jee-preparation")
|
| 37 |
+
swot_bot.add("https://engineering.careers360.com/articles/how-prepare-for-jee-main")
|
| 38 |
+
|
| 39 |
+
swot_bot.add("https://www.allenoverseas.com/blog/jee-main-2024-exam-strategies-subject-wise-preparation-tips/")
|
| 40 |
+
swot_bot.add("https://www.vedantu.com/jee-main/topics")
|
| 41 |
+
swot_bot.add("https://www.pw.live/exams/wp-content/uploads/2024/01/syllabus-for-jee-main-2024-as-on-01-november-2023-1-3.pdf")
|
| 42 |
+
swot_bot.add("https://www.pw.live/exams/wp-content/uploads/2024/01/syllabus-for-jee-main-2024-as-on-01-november-2023-4-8.pdf")
|
| 43 |
+
swot_bot.add("https://www.pw.live/exams/jee/jee-main-chemistry-syllabus/")
|
| 44 |
+
|
| 45 |
+
swot_bot.add("https://www.pw.live/topics-chemistry-class-11")
|
| 46 |
+
swot_bot.add("https://www.pw.live/topics-chemistry-class-12")
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
@app.post("/")
|
| 50 |
+
async def get_analysis(str: UserPromptInput):
|
| 51 |
+
|
| 52 |
+
output = swot_bot.query(UserPromptInput)
|
| 53 |
+
return {"query": output}
|