GithubHelp home page GithubHelp logo

alfredodeza / try-huggingface Goto Github PK

View Code? Open in Web Editor NEW
13.0 3.0 51.0 14 KB

Examples to try HuggingFace datasets and transformers

License: MIT License

Jupyter Notebook 82.31% Dockerfile 17.69%

try-huggingface's Introduction

try-huggingface's People

Contributors

alfredodeza avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

try-huggingface's Issues

missing dependencies from try-transformers.ipynb

seeing the following error, suggests that neither PyTorch nor Transformers is install. I did install everything from the requirements file

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Cell In[7], <a href='vscode-notebook-cell:?execution_count=7&line=1'>line 1</a>
----> <a href='vscode-notebook-cell:?execution_count=7&line=1'>1</a> generator = pipeline("text2text-generation", model="t5-base")

File [/usr/local/lib/python3.8/site-packages/transformers/pipelines/__init__.py:650](https://1ro42ki55dt3ruhma24vqpnvk3f08vlr8iv0pmnqmnr22gut00tn.assets.github.dev/usr/local/lib/python3.8/site-packages/transformers/pipelines/__init__.py:650), in pipeline(task, model, config, tokenizer, feature_extractor, framework, revision, use_fast, use_auth_token, device_map, torch_dtype, trust_remote_code, model_kwargs, pipeline_class, **kwargs)
    <a href='/usr/local/lib/python3.8/site-packages/transformers/pipelines/__init__.py:646'>646</a> # Infer the framework from the model
    <a href='/usr/local/lib/python3.8/site-packages/transformers/pipelines/__init__.py:647'>647</a> # Forced if framework already defined, inferred if it's None
    <a href='/usr/local/lib/python3.8/site-packages/transformers/pipelines/__init__.py:648'>648</a> # Will load the correct model if possible
    <a href='/usr/local/lib/python3.8/site-packages/transformers/pipelines/__init__.py:649'>649</a> model_classes = {"tf": targeted_task["tf"], "pt": targeted_task["pt"]}
--> <a href='/usr/local/lib/python3.8/site-packages/transformers/pipelines/__init__.py:650'>650</a> framework, model = infer_framework_load_model(
    <a href='/usr/local/lib/python3.8/site-packages/transformers/pipelines/__init__.py:651'>651</a>     model,
    <a href='/usr/local/lib/python3.8/site-packages/transformers/pipelines/__init__.py:652'>652</a>     model_classes=model_classes,
    <a href='/usr/local/lib/python3.8/site-packages/transformers/pipelines/__init__.py:653'>653</a>     config=config,
    <a href='/usr/local/lib/python3.8/site-packages/transformers/pipelines/__init__.py:654'>654</a>     framework=framework,
    <a href='/usr/local/lib/python3.8/site-packages/transformers/pipelines/__init__.py:655'>655</a>     task=task,
    <a href='/usr/local/lib/python3.8/site-packages/transformers/pipelines/__init__.py:656'>656</a>     **hub_kwargs,
    <a href='/usr/local/lib/python3.8/site-packages/transformers/pipelines/__init__.py:657'>657</a>     **model_kwargs,
    <a href='/usr/local/lib/python3.8/site-packages/transformers/pipelines/__init__.py:658'>658</a> )
    <a href='/usr/local/lib/python3.8/site-packages/transformers/pipelines/__init__.py:660'>660</a> model_config = model.config
    <a href='/usr/local/lib/python3.8/site-packages/transformers/pipelines/__init__.py:662'>662</a> load_tokenizer = type(model_config) in TOKENIZER_MAPPING or model_config.tokenizer_class is not None

File [/usr/local/lib/python3.8/site-packages/transformers/pipelines/base.py:209](https://1ro42ki55dt3ruhma24vqpnvk3f08vlr8iv0pmnqmnr22gut00tn.assets.github.dev/usr/local/lib/python3.8/site-packages/transformers/pipelines/base.py:209), in infer_framework_load_model(model, config, model_classes, task, framework, **model_kwargs)
    <a href='/usr/local/lib/python3.8/site-packages/transformers/pipelines/base.py:183'>183</a> """
    <a href='/usr/local/lib/python3.8/site-packages/transformers/pipelines/base.py:184'>184</a> Select framework (TensorFlow or PyTorch) to use from the `model` passed. Returns a tuple (framework, model).
...
    <a href='/usr/local/lib/python3.8/site-packages/transformers/pipelines/base.py:213'>213</a>     )
    <a href='/usr/local/lib/python3.8/site-packages/transformers/pipelines/base.py:214'>214</a> if isinstance(model, str):
    <a href='/usr/local/lib/python3.8/site-packages/transformers/pipelines/base.py:215'>215</a>     model_kwargs["_from_pipeline"] = task

RuntimeError: At least one of TensorFlow 2.0 or PyTorch should be installed. To install TensorFlow 2.0, read the instructions at https://www.tensorflow.org/install/ To install PyTorch, read the instructions at https://pytorch.org/.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.