Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backend - Process User Input and Return Model Response #38

Open
AjithAkuthota23 opened this issue Nov 4, 2024 · 0 comments · May be fixed by #39
Open

Backend - Process User Input and Return Model Response #38

AjithAkuthota23 opened this issue Nov 4, 2024 · 0 comments · May be fixed by #39
Assignees

Comments

@AjithAkuthota23
Copy link
Collaborator

AjithAkuthota23 commented Nov 4, 2024

Develop the backend functionality to handle incoming user input from the frontend, process it, and return a response generated by a model. For testing and demonstration purposes, we will use the Hugging Face model (Salesforce/codet5-base) (https://huggingface.co/Salesforce/codet5-base) as a mock model. This backend API will enable interaction between the frontend’s user input and the model's response, allowing the UI to simulate conversation with an AI model in a chat format.

Acceptance Criteria:

  • Endpoint Setup:

    • Create an API endpoint that accepts a POST request with JSON data
    • Validate the request to ensure the "text" field is present and non-empty.
  • Process Input with Mock Model:

    • Use the Hugging Face model Salesforce/codet5-base as a mock to generate responses. This model will serve as a placeholder to test the system until the actual model is integrated.
    • Integrate the Hugging Face API or Transformers library to interact with the model and process the user’s input.
  • Model Processing Script:

    • Set up a Python script using the transformers library that takes in the text input, runs it through the Salesforce/codet5-base model, and returns the generated output.(You can find the model script in the link with description)
    • This script will serve as a backend utility that can be called by the API to generate responses.
  • Response Handling:

    • Return the model’s output in a JSON format so the frontend can display it.
    • If there is any processing error, return an appropriate error message with a clear HTTP status code.
  • Error Handling:

    • Handle possible errors such as invalid input, model processing failures, and server errors.
    • Provide meaningful error messages for each error type.

Additional Information:

  • This setup is intended as a mock to test the chat interface and backend flow.
  • Later, the mock model can be replaced with the actual bioinformatics model once it is ready for integration.
@Omp06 Omp06 self-assigned this Nov 6, 2024
@Omp06 Omp06 linked a pull request Nov 11, 2024 that will close this issue
@Omp06 Omp06 linked a pull request Nov 11, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants