Skip to content

Commit

Permalink
Merge branch 'dev' into Rahul-540
Browse files Browse the repository at this point in the history
  • Loading branch information
ishvindersethi22 authored Dec 20, 2024
2 parents 8f52f24 + b0f5210 commit 0411e22
Show file tree
Hide file tree
Showing 22 changed files with 1,307 additions and 761 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.7
- name: Set up Python 3.9.20
uses: actions/setup-python@v1
with:
python-version: 3.7
python-version: 3.9.20
- name: Debug Message - Check Github branch
run: echo "Current Git branch is ${GITHUB_REF##*/}"
- name: Install Black
run: pip install black
run: pip install black==23.1.0
- name: Run black --check . to check for code formatting.
run: black --check .
run: black --check .
1 change: 1 addition & 0 deletions backend/anudesh_backend/logger.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Defines the logging format for the console logger
"""

import logging
from django.utils.termcolors import colorize

Expand Down
140 changes: 140 additions & 0 deletions backend/dataset/migrations/0055_auto_20241029_0902.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
# Generated by Django 3.2.14 on 2024-10-29 09:02

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("tasks", "0050_alter_annotation_unique_together"),
("dataset", "0054_auto_20241016_0456"),
]

operations = [
migrations.RemoveField(
model_name="conversation",
name="datasetbase_ptr",
),
migrations.RemoveField(
model_name="ocrdocument",
name="datasetbase_ptr",
),
migrations.RemoveField(
model_name="sentencetext",
name="datasetbase_ptr",
),
migrations.RemoveField(
model_name="speechconversation",
name="datasetbase_ptr",
),
migrations.RemoveField(
model_name="translationpair",
name="datasetbase_ptr",
),
migrations.AlterField(
model_name="datasetinstance",
name="dataset_type",
field=models.CharField(
choices=[
("PromptBase", "PromptBase"),
("PromptAnswer", "PromptAnswer"),
("PromptAnswerEvaluation", "PromptAnswerEvaluation"),
("Interaction", "Interaction"),
("Instruction", "Instruction"),
("MultiModelInteraction", "MultiModelInteraction"),
],
help_text="Dataset Type which is specific for each annotation task",
max_length=100,
verbose_name="dataset_type",
),
),
migrations.AlterField(
model_name="promptanswer",
name="language",
field=models.CharField(
choices=[
("English", "English"),
("Assamese", "Assamese"),
("Bengali", "Bengali"),
("Bodo", "Bodo"),
("Dogri", "Dogri"),
("Filipino", "Filipino"),
("Gujarati", "Gujarati"),
("Hindi", "Hindi"),
("Kannada", "Kannada"),
("Kashmiri", "Kashmiri"),
("Konkani", "Konkani"),
("Maithili", "Maithili"),
("Malayalam", "Malayalam"),
("Manipuri", "Manipuri"),
("Marathi", "Marathi"),
("Nepali", "Nepali"),
("Odia", "Odia"),
("Punjabi", "Punjabi"),
("Sanskrit", "Sanskrit"),
("Santali", "Santali"),
("Sindhi", "Sindhi"),
("Sinhala", "Sinhala"),
("Tamil", "Tamil"),
("Telugu", "Telugu"),
("Thai", "Thai"),
("Urdu", "Urdu"),
],
max_length=15,
verbose_name="language",
),
),
migrations.AlterField(
model_name="promptbase",
name="language",
field=models.CharField(
choices=[
("English", "English"),
("Assamese", "Assamese"),
("Bengali", "Bengali"),
("Bodo", "Bodo"),
("Dogri", "Dogri"),
("Filipino", "Filipino"),
("Gujarati", "Gujarati"),
("Hindi", "Hindi"),
("Kannada", "Kannada"),
("Kashmiri", "Kashmiri"),
("Konkani", "Konkani"),
("Maithili", "Maithili"),
("Malayalam", "Malayalam"),
("Manipuri", "Manipuri"),
("Marathi", "Marathi"),
("Nepali", "Nepali"),
("Odia", "Odia"),
("Punjabi", "Punjabi"),
("Sanskrit", "Sanskrit"),
("Santali", "Santali"),
("Sindhi", "Sindhi"),
("Sinhala", "Sinhala"),
("Tamil", "Tamil"),
("Telugu", "Telugu"),
("Thai", "Thai"),
("Urdu", "Urdu"),
],
max_length=15,
verbose_name="language",
),
),
migrations.DeleteModel(
name="BlockText",
),
migrations.DeleteModel(
name="Conversation",
),
migrations.DeleteModel(
name="OCRDocument",
),
migrations.DeleteModel(
name="SentenceText",
),
migrations.DeleteModel(
name="SpeechConversation",
),
migrations.DeleteModel(
name="TranslationPair",
),
]
3 changes: 3 additions & 0 deletions backend/dataset/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Model definitions for Dataset Management
"""

from django.db import models
from users.models import User, LANG_CHOICES
from organizations.models import Organization
Expand Down Expand Up @@ -89,6 +90,7 @@
("English", "English"),
("Assamese", "Assamese"),
("Bengali", "Bengali"),
("Burmese", "Burmese"),
("Bodo", "Bodo"),
("Dogri", "Dogri"),
("Gujarati", "Gujarati"),
Expand All @@ -109,6 +111,7 @@
("Sinhala", "Sinhala"),
("Tamil", "Tamil"),
("Telugu", "Telugu"),
("Thai", "Thai"),
("Urdu", "Urdu"),
]

Expand Down
1 change: 1 addition & 0 deletions backend/dataset/resources.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Module to store Import-Export resource classes
"""

from import_export.resources import ModelResource
from .models import *
from .mixins import ResourceMixin
Expand Down
1 change: 1 addition & 0 deletions backend/dataset/serializers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Module to store Django REST Framework Serializers for dataset related models
"""

from django_celery_results.models import TaskResult
from rest_framework import serializers

Expand Down
6 changes: 3 additions & 3 deletions backend/dataset/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
convert_seconds_to_hours,
get_audio_project_types,
get_audio_transcription_duration,
calculate_word_error_rate_between_two_audio_transcription_annotation,
calculate_word_error_rate_between_two_llm_prompts,
ocr_word_count,
)

Expand Down Expand Up @@ -1020,7 +1020,7 @@ def project_analytics(self, request, pk=None):
)
)
total_word_error_rate_ar_list.append(
calculate_word_error_rate_between_two_audio_transcription_annotation(
calculate_word_error_rate_between_two_llm_prompts(
review_annotation.result,
review_annotation.parent_annotation.result,
)
Expand Down Expand Up @@ -1049,7 +1049,7 @@ def project_analytics(self, request, pk=None):
)
)
total_word_error_rate_rs_list.append(
calculate_word_error_rate_between_two_audio_transcription_annotation(
calculate_word_error_rate_between_two_llm_prompts(
supercheck_annotation.result,
supercheck_annotation.parent_annotation.result,
)
Expand Down
Loading

0 comments on commit 0411e22

Please sign in to comment.