Rasa Chatbot traing error -> AttributeError: 'str' object has no attribute 'get' - rasa-nlu

Getting this error while trying to training.

There is an error in your config.yml in the pipeline section. It should look like this:
language: en
pipeline:
- name: ConveRTTokenizer
- name: ConveRTFeaturizer
- name: RegexFeaturizer
sounds like you have either forgotten the dashes, or forgotten the name tag, or something like that.

Related

How to reference OpenAPI operation description from an external file?

Is it possible to reference OpenAPI operation description from an external file?
Here is my sample code. I want to keep the description "This API is used to get user details" in a separate file and use it here like a variable or template or as a reference. Is there any way to do this?
get:
tags:
- User
summary: Get user details
description: This API is used to get user details
operationId: updateUser
parameters:
- name: userid
in: path
description: The id that needs to be pulled
required: true
schema:
type: string
If you use Redocly CLI to bundle, then you can put it in a separate file like this:
get:
tags:
- User
summary: Get user details
description:
$ref: ./updateUser-description.md
operationId: updateUser
parameters:
- name: userid
in: path
description: The id that needs to be pulled
required: true
schema:
type: string
Then, in a separate file named updateUser-description.md (note, you could change the name too):
This API is used to get user details
Then, when you run the bundle command it resolves the $ref and replaces the description with the contents in that corresponding Markdown file.
npx #redocly/cli bundle my-openapi.yaml

Rasa integration pipeline with HuggingFace

I'm trying to configure Rasa to use models pretrained at HuggingFace. This is my setup
language: fr
pipeline:
- name: LanguageModelTokenizer
- name: LanguageModelFeaturizer
model_name: "bert"
model_weights: "setu4993/LaBSE"
cache_dir: "/rasa/model"
The HuggingFace model is here
After I run “rasa train”, it says OSError: Model name “setu4993/LaBSE” was not found. Any idea how to integrate this huggingface model to Rasa?
Can we include multiple HuggingFace pipeline in Rasa configuration? Example
pipeline:
- model_name: "bert"
...
- model_name: "xlnet"
In order to use HuggingFace Transformers in your pipeline in your config.yml file,
you have to do the following:
run the following in your terminal pip install rasa[transformers] --use-feature=2020-solver
in your config.yml file you add the following:
- name: HFTransformersNLP
model_name: "bert" # Name of the language model to use
model_weights: "rasa/LaBSE" # Pre-Trained weights to be loaded
- name: LanguageModelTokenizer
- name: LanguageModelFeaturizer

How to give same 'get' to multiple jobs in concourse

Instead of giving the same '- get' to multiple jobs, is there any way that I can optimize my code by giving common '- get', if it is allowed in any way.
Currently, I have given the same code (- get) for different jobs
jobs:
- name: Name1
plan:
- aggregate:
- get: anyrepo1
- get: anyrepo2
- task: taskhere
image: anyimage1
file: file1.yml
- name: Name2
plan:
- aggregate:
- get: anyrepo1
- get: anyrepo2
- task: taskhere
image: anyimage1
file: file2.yml
I am not getting any error, but want to optimize the code
Ah, it seems that the "optimization" you are looking for is at the YAML level. You want to reduce YAML duplication. This is independent from Concourse, this technique can be applied to any YAML file.
You can use YAML merge keys and anchors.
See
YAML tips and tricks for Concourse CI https://blog.betomorrow.com/yaml-tips-and-tricks-for-concourse-ci-35a3b577a239
YAML anchor and merge key reference https://camel.readthedocs.io/en/latest/yamlref.html
You can use below code to reuse the same thing again and again. In my case i am using a variable "jobs_get_common".
`jobs_get_common: &jobs_get_common
- get: repo1
- get: repo2
jobs:
- name: Converge-BHS
plan:
- aggregate:
*jobs_get_common
- task: anytask
image: image1
file: task.yml`

How to prevent Ruby's YAML parser from trying to parse {{var-name}}

I have a bunch of concourse pipeline files that look like the following:
---
resources:
- name: example
type: git
source:
uri: git#github.internal.me.com:me/example.git
branch: {{tracking_branch}}
private_key: {{ssh_key}}
paths:
- code/src/do/teams/sampleapp
params:
depth: 1
- name: deploy-image
type: docker-image
source:
repository: {{docker_image_url}}
And I want to parse them in ruby to perform a bunch of transformations (like validating them and updating some keys if they are missing).
Problem is, whenever I try to load and them dump them back to files the pieces that have {{something}} become:
branch:
? tracking_branch:
:
private_key:
? ssh_key:
:
Why is it doing this and is there any way I can configure the parser not to do this? Just leave these variables as they are?
To avoid conflict with YAML's internal syntax you need to quote your values:
---
resources:
- name: example
type: git
source:
uri: git#github.internal.me.com:me/example.git
branch: '{{tracking_branch}}'
private_key: '{{ssh_key}}'
paths:
- code/src/do/teams/sampleapp
params:
depth: 1
This sort of thing comes up in Ansible configuration files all the time for similar reasons.
The { and } characters are used in Yaml for flow mappings (i.e. hashes). If you don’t provide a value for a mapping entry you get nil.
So in the case of branch: {{tracking_branch}}, since there are two pairs of braces, you get a hash with a key branch and value (in Ruby) of
{{"tracking_branch"=>nil}=>nil}
When this is dumped back out to Yaml you get the somewhat awwkward and verbose:
branch:
? tracking_branch:
:
The solution is simply to quote the value:
branch: "{{tracking_branch}}"
Completely forgot that concourse now offers ((var-name)) for templating, just switched to that instead of {{var-name}} at the pipelines and the YAML parser is now happy!

task config not found

I am getting
task config 'get-snapshot-jar/infra/hw.yml
not found error. I have written a very simple pipeline .yml, this yml will connect to artifactory resource and run another yml which is defined in task section.
my pipeline.yml looks like:
resources:
- name: get-snapshot-jar
type: docker-image
source: <artifactory source>
repository: <artifactory repo>
username: {{artifactory-username}}
password: {{artifactory-password}}
jobs:
- name: create-artifact
plan:
- get: get-snapshot-jar
trigger: true
- task: copy-artifact-from-artifact-repo
file: get-snapshot-jar/infra/hw.yml
Artifactiory is working fine after that I am getting an error
enter image description here
copy-artifact-from-artifact-repo
task config 'get-snapshot-jar/infra/hw.yml' not found
You need to specify an input for your copy-artifact-from-artifact-repo task which passes the get-snapshot-jar resource to the tasks docker container. Take a look at this post where someone runs into a similar problem Trigger events in Concourse .
Also your file variable looks weird. Your are referencing a docker-image resource which, according to the official concourse-resource github repo, has no yml files inside.
Generally i would keep my task definitions as close as possible to the pipeline code. If you have to reach out to different repos you might loose the overview if your pipeline keeps growing.
cheers,

Resources