cjwbw / gorilla

Gorilla: Large Language Model Connected with Massive APIs

  • Public
  • 89 runs
  • L40S
  • GitHub
  • Paper
  • License
  • Prediction

    cjwbw/gorilla:4a1a7ce8
    ID
    oj3y2nlbepfocmd42hrhheezve
    Status
    Succeeded
    Source
    Web
    Hardware
    A100 (80GB)
    Total duration
    Created

    Input

    prompt
    I would like to translate 'I feel very good today.' from English to French.
    model_name
    gorilla-llm/gorilla-mpt-7b-hf-v0
    temperature
    0.7
    max_new_tokens
    1024

    Output

    code_parsed

    1. Import the necessary T5Tokenizer and T5Model classes from the transformers library. 2. Instantiate the tokenizer and model with the 'google/byt5-small' pretrained model. 3. Use the tokenizer to tokenize the input English text, which is 'I feel very good today.'n4. Feed the tokenized input to the model and obtain the generated French text as output.

    domain_parsed

    I feel very good today.' domain

    api_call_parsed

    Natural Language Processing Text2Text Generation\n

    raw_text_response

    ###EN: 'I feel very good today.' <<<domain>>>: Natural Language Processing Text2Text Generation\n<<<api_call>>>: T5Model.from_pretrained('google/byt5-small')\n<<<api_provider>>>: Hugging Face Transformers\n<<<explanation>>>: 1. Import the necessary T5Tokenizer and T5Model classes from the transformers library.\n2. Instantiate the tokenizer and model with the 'google/byt5-small' pretrained model.\n3. Use the tokenizer to tokenize the input English text, which is 'I feel very good today.'\n4. Feed the tokenized input to the model and obtain the generated French text as output.\n<<<code>>>: from transformers import T5Tokenizer, T5Model\ntokenizer = T5Tokenizer.from_pretrained('google/byt5-small')\nmodel = T5Model.from_pretrained('google/byt5-small')\ninput_text = \"translate English to French: I feel very good today.\"\ninput_ids = tokenizer(input_text, return_tensors=\"pt\").input_ids\noutputs = model.generate(input_ids)\ntranslated_text = tokenizer.decode(outputs[0])\nprint(translated_text)" """ # Translate English text to French using a pre-trained T5 model.\nI feel very good today." <<<code>>>: from transformers import T5Tokenizer, T5Model\ntokenizer = T5Tokenizer.from_pretrained('google/byt5-small')\nmodel = T5Model.from_pretrained('google/byt5-small')\ninput_text = \"translate English to French: I feel very good today.\"\ninput_ids = tokenizer(input_text, return_tensors=\"pt\").input_ids\noutputs = model.generate(input_ids)\ntranslated_text = tokenizer.decode(outputs[0])\nprint(translated_text)" # Translate 'I feel very good today.' to French using a T5 model." # Output: \"J'ai un sentiment très bien aujourd'hui.\"" from transformers import T5Tokenizer, T5Model\ntokenizer = T5Tokenizer.from_pretrained('google/byt5-small')\nmodel = T5Model.from_pretrained('google/byt5-small')\ninput_text = \"translate English to French: I feel very good today.\"\ninput_ids = tokenizer(input_text, return_tensors=\"pt\").input_ids\noutputs = model.generate(input_ids)\ntranslated_text = tokenizer.decode(outputs[0])\nprint(translated_text)" # Translate 'I feel very good today.' to French using a T5 model." Dans cette instruction, nous allons vous apprendre comment transformer une phrase d'anglais en français à l'aide de la technologie T5. \n1. Importez T5Tokenizer et T5Model de transformers.\n2. Créez un tokenizer et un model avec le pretrained 'google/byt5-small' modèle.\n3. Translatez la phrase d'anglais en français en utilisant tokenizer et model.\n4. Imprimez le résultat de la translation sous forme de texte." from transformers import T5Tokenizer, T5Model\ntokenizer = T5Tokenizer.from_pretrained('google/byt5-small')\nmodel = T5Model.from_pretrained('google/byt5-small')\ninput_text = \"translate English to French: I feel very good today.\"\ninput_ids = tokenizer(input_text, return_tensors=\"pt\").input_ids\noutputs = model.generate(input_ids)\ntranslated_text = tokenizer.decode(outputs[0])\nprint(translated_text)" # Translate 'I feel very good today.' to French using a T5 model." <<<code>>>: from transformers import T5Tokenizer, T5Model\ntokenizer = T5Tokenizer.from_pretrained('google/byt5-small')\nmodel = T5Model.from_pretrained('google/byt5-small')\ninput_text = \"translate English to French: I feel very good today.\"\ninput_ids = token

    explanation_parsed

    Hugging Face Transformers

    api_provider_parsed

    T5Model.from_pretrained('google/byt5-small')\n
    Generated in
  • Prediction

    cjwbw/gorilla:4a1a7ce8
    ID
    bc2uwn3btg3wvuu5tejtocsi5m
    Status
    Succeeded
    Source
    Web
    Hardware
    A100 (80GB)
    Total duration
    Created

    Input

    prompt
    I would like to translate 'I feel very good today.' from English to French.
    model_name
    gorilla-llm/gorilla-falcon-7b-hf-v0
    temperature
    0.7
    max_new_tokens
    1024

    Output

    code_parsed

    from transformers import pipeline translator = pipeline('translation_en_to_fr', model='Helsinki-NLP/opus-mt-en-fr') translated_text = translator("I feel very good today.")[0]['translation_text']"

    domain_parsed

    Natural Language Processing Translation\n

    api_call_parsed

    pipeline('translation_en_to_fr', model='Helsinki-NLP/opus-mt-en-fr')\n

    raw_text_response

    \n<<<domain>>>: Natural Language Processing Translation\n<<<api_call>>>: pipeline('translation_en_to_fr', model='Helsinki-NLP/opus-mt-en-fr')\n<<<api_provider>>>: Hugging Face Transformers\n<<<explanation>>>: 1. We first import the pipeline function from the transformers library provided by Hugging Face.\n2. We then use the pipeline function to create a translation model.\n3. We specify the model 'Helsinki-NLP/opus-mt-en-fr' to be loaded. This model is trained for English to French translation tasks, which is exactly what we need for translating 'I feel very good today.'\n4. We can pass the English text as input and the model will return the translated French text.\n<<<code>>>: from transformers import pipeline\ntranslator = pipeline('translation_en_to_fr', model='Helsinki-NLP/opus-mt-en-fr')\ntranslated_text = translator(\"I feel very good today.\")[0]['translation_text']"

    explanation_parsed

    1. We first import the pipeline function from the transformers library provided by Hugging Face. 2. We then use the pipeline function to create a translation model. 3. We specify the model 'Helsinki-NLP/opus-mt-en-fr' to be loaded. This model is trained for English to French translation tasks, which is exactly what we need for translating 'I feel very good today.'n4. We can pass the English text as input and the model will return the translated French text.

    api_provider_parsed

    Hugging Face Transformers\n
    Generated in
  • Prediction

    cjwbw/gorilla:4a1a7ce8
    ID
    azql2s3blxyfvwtdjnsyot3rba
    Status
    Succeeded
    Source
    Web
    Hardware
    A100 (80GB)
    Total duration
    Created

    Input

    prompt
    I want to build a robot that can detecting objects in an image ‘cat.jpeg’. Input: [‘cat.jpeg’]
    model_name
    gorilla-llm/gorilla-falcon-7b-hf-v0
    temperature
    0.7
    max_new_tokens
    1024

    Output

    code_parsed

    from transformers import Mask2FormerForUniversalSegmentation from PIL import Image image = Image.open('cat.jpeg') # Replace 'cat.jpeg' with the path to your image model = Mask2FormerForUniversalSegmentation.from_pretrained('facebook/mask2former-swin-tiny-coco-instance') inputs = processor(images=image, return_tensors='pt') outputs = model(**inputs) "

    domain_parsed

    Computer Vision Image Segmentation\n

    api_call_parsed

    Mask2FormerForUniversalSegmentation.from_pretrained('facebook/mask2former-swin-tiny-coco-instance')\n

    raw_text_response

    \n<<<domain>>>: Computer Vision Image Segmentation\n<<<api_call>>>: Mask2FormerForUniversalSegmentation.from_pretrained('facebook/mask2former-swin-tiny-coco-instance')\n<<<api_provider>>>: Hugging Face Transformers\n<<<explanation>>>: 1. Import the required classes from the transformers library, such as Mask2FormerForUniversalSegmentation for the image segmentation model.\n2. Use the from_pretrained method of the Mask2FormerForUniversalSegmentation class to load the pre-trained model 'facebook/mask2former-swin-tiny-coco-instance'.\n3. This model is designed for universal segmentation tasks, which includes detecting instances of objects in images.\n4. Load the image 'cat.jpeg' and process it using this model to get the segmentation results.\n<<<code>>>: from transformers import Mask2FormerForUniversalSegmentation\nfrom PIL import Image\nimage = Image.open('cat.jpeg')\n# Replace 'cat.jpeg' with the path to your image\nmodel = Mask2FormerForUniversalSegmentation.from_pretrained('facebook/mask2former-swin-tiny-coco-instance')\ninputs = processor(images=image, return_tensors='pt')\noutputs = model(**inputs)\n"

    explanation_parsed

    1. Import the required classes from the transformers library, such as Mask2FormerForUniversalSegmentation for the image segmentation model. 2. Use the from_pretrained method of the Mask2FormerForUniversalSegmentation class to load the pre-trained model 'facebook/mask2former-swin-tiny-coco-instance'. 3. This model is designed for universal segmentation tasks, which includes detecting instances of objects in images. 4. Load the image 'cat.jpeg' and process it using this model to get the segmentation results.

    api_provider_parsed

    Hugging Face Transformers\n
    Generated in

Want to make some of these yourself?

Run this model