Spaces:
Paused
Paused
M Farrel Danendra Rachim commited on
Commit ·
7bc1a6b
1
Parent(s): 58e8b4f
ddd
Browse files- .idea/.gitignore +3 -0
- .idea/aibeecara-models-2.iml +10 -0
- .idea/inspectionProfiles/Project_Default.xml +18 -0
- .idea/inspectionProfiles/profiles_settings.xml +6 -0
- .idea/misc.xml +7 -0
- .idea/modules.xml +8 -0
- .idea/vcs.xml +6 -0
- main.py +4 -1
.idea/.gitignore
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Default ignored files
|
| 2 |
+
/shelf/
|
| 3 |
+
/workspace.xml
|
.idea/aibeecara-models-2.iml
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
+
<module type="PYTHON_MODULE" version="4">
|
| 3 |
+
<component name="NewModuleRootManager">
|
| 4 |
+
<content url="file://$MODULE_DIR$">
|
| 5 |
+
<excludeFolder url="file://$MODULE_DIR$/.venv" />
|
| 6 |
+
</content>
|
| 7 |
+
<orderEntry type="jdk" jdkName="Python 3.12 (aibeecara-models-2)" jdkType="Python SDK" />
|
| 8 |
+
<orderEntry type="sourceFolder" forTests="false" />
|
| 9 |
+
</component>
|
| 10 |
+
</module>
|
.idea/inspectionProfiles/Project_Default.xml
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<component name="InspectionProjectProfileManager">
|
| 2 |
+
<profile version="1.0">
|
| 3 |
+
<option name="myName" value="Project Default" />
|
| 4 |
+
<inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
|
| 5 |
+
<option name="ignoredPackages">
|
| 6 |
+
<value>
|
| 7 |
+
<list size="5">
|
| 8 |
+
<item index="0" class="java.lang.String" itemvalue="pandas" />
|
| 9 |
+
<item index="1" class="java.lang.String" itemvalue="chromadb" />
|
| 10 |
+
<item index="2" class="java.lang.String" itemvalue="streamlit" />
|
| 11 |
+
<item index="3" class="java.lang.String" itemvalue="plotly" />
|
| 12 |
+
<item index="4" class="java.lang.String" itemvalue="numpy" />
|
| 13 |
+
</list>
|
| 14 |
+
</value>
|
| 15 |
+
</option>
|
| 16 |
+
</inspection_tool>
|
| 17 |
+
</profile>
|
| 18 |
+
</component>
|
.idea/inspectionProfiles/profiles_settings.xml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<component name="InspectionProjectProfileManager">
|
| 2 |
+
<settings>
|
| 3 |
+
<option name="USE_PROJECT_PROFILE" value="false" />
|
| 4 |
+
<version value="1.0" />
|
| 5 |
+
</settings>
|
| 6 |
+
</component>
|
.idea/misc.xml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
+
<project version="4">
|
| 3 |
+
<component name="Black">
|
| 4 |
+
<option name="sdkName" value="Python 3.12 (aibeecara-models-2)" />
|
| 5 |
+
</component>
|
| 6 |
+
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.12 (aibeecara-models-2)" project-jdk-type="Python SDK" />
|
| 7 |
+
</project>
|
.idea/modules.xml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
+
<project version="4">
|
| 3 |
+
<component name="ProjectModuleManager">
|
| 4 |
+
<modules>
|
| 5 |
+
<module fileurl="file://$PROJECT_DIR$/.idea/aibeecara-models-2.iml" filepath="$PROJECT_DIR$/.idea/aibeecara-models-2.iml" />
|
| 6 |
+
</modules>
|
| 7 |
+
</component>
|
| 8 |
+
</project>
|
.idea/vcs.xml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
+
<project version="4">
|
| 3 |
+
<component name="VcsDirectoryMappings">
|
| 4 |
+
<mapping directory="" vcs="Git" />
|
| 5 |
+
</component>
|
| 6 |
+
</project>
|
main.py
CHANGED
|
@@ -24,6 +24,9 @@ class Request(BaseModel):
|
|
| 24 |
class Response(BaseModel):
|
| 25 |
text: str
|
| 26 |
|
|
|
|
|
|
|
|
|
|
| 27 |
@app.post("/grammar-correct", response_model=Response)
|
| 28 |
async def grammar_correct(request: Request):
|
| 29 |
try:
|
|
@@ -36,7 +39,7 @@ async def grammar_correct(request: Request):
|
|
| 36 |
async def cefr_vocab(request: Request):
|
| 37 |
try:
|
| 38 |
result = cefr_classifier(request.text)
|
| 39 |
-
return {"
|
| 40 |
except Exception as e:
|
| 41 |
return {"text": f"Error: {str(e)}"}
|
| 42 |
|
|
|
|
| 24 |
class Response(BaseModel):
|
| 25 |
text: str
|
| 26 |
|
| 27 |
+
class ArrayResponse(BaseModel):
|
| 28 |
+
text: list
|
| 29 |
+
|
| 30 |
@app.post("/grammar-correct", response_model=Response)
|
| 31 |
async def grammar_correct(request: Request):
|
| 32 |
try:
|
|
|
|
| 39 |
async def cefr_vocab(request: Request):
|
| 40 |
try:
|
| 41 |
result = cefr_classifier(request.text)
|
| 42 |
+
return {"label": result[0]['label']}
|
| 43 |
except Exception as e:
|
| 44 |
return {"text": f"Error: {str(e)}"}
|
| 45 |
|