Create requirements.txt

#34

Creating an inference endpoint fails because requirements.txt is not there and einpos is not added as a dependency:
Created the requirements.txt file and added einpos as a dependency.

Endpoint encountered an error.
You can try restarting it using the "pause" button above. Check  logs for more details.
[Server message]Endpoint failed to start
See details
Exit code: 3. Reason: 0/dist-packages/starlette/routing.py", line 732, in lifespan
    async with self.lifespan_context(app) as maybe_state:
  File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 608, in __aenter__
    await self._router.startup()
  File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 709, in startup
    await handler()
  File "/app/webservice_starlette.py", line 60, in some_startup_task
    inference_handler = get_inference_handler_either_custom_or_default_handler(HF_MODEL_DIR, task=HF_TASK)
  File "/app/huggingface_inference_toolkit/handler.py", line 50, in get_inference_handler_either_custom_or_default_handler
    custom_pipeline = check_and_register_custom_pipeline_from_directory(model_dir)
  File "/app/huggingface_inference_toolkit/utils.py", line 186, in check_and_register_custom_pipeline_from_directory
    custom_pipeline = handler.EndpointHandler(model_dir)
  File "/repository/handler.py", line 10, in __init__
    self.model = AutoModelForCausalLM.from_pretrained(self.model_id, trust_remote_code=True)
  File "/usr/local/lib/python3.10/dist-packages/transformers/models/auto/auto_factory.py", line 548, in from_pretrained
    model_class = get_class_from_dynamic_module(
  File "/usr/local/lib/python3.10/dist-packages/transformers/dynamic_module_utils.py", line 488, in get_class_from_dynamic_module
    final_module = get_cached_module_file(
  File "/usr/local/lib/python3.10/dist-packages/transformers/dynamic_module_utils.py", line 352, in get_cached_module_file
    get_cached_module_file(
  File "/usr/local/lib/python3.10/dist-packages/transformers/dynamic_module_utils.py", line 314, in get_cached_module_file
    modules_needed = check_imports(resolved_module_file)
  File "/usr/local/lib/python3.10/dist-packages/transformers/dynamic_module_utils.py", line 180, in check_imports
    raise ImportError(
ImportError: This modeling file requires the following packages that were not found in your environment: einops. Run `pip install einops`

Application startup failed. Exiting.
vikhyatk changed pull request status to merged

Sign up or log in to comment