Rasa Open Source 2.0 is out now!

If you run python, and type import tensorflow and print(tensorflow), what is happening?

(auraenv) c:\devp\aura>python Python 3.8.5 (default, Sep 3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32 Type “help”, “copyright”, “credits” or “license” for more information.

import tensorflow 2020-10-12 19:58:45.876092: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library ‘cudart64_101.dll’; dlerror: cudart64_101.dll not found 2020-10-12 19:58:45.876252: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.

so tensorflow is not installed atm but the GPU is not being used.

print (tensorflow) <module ‘tensorflow’ from ‘C:\Users\tariq\anaconda3\envs\auraenv\lib\site-packages\tensorflow\init.py’>

I understand that tensorflow is installed, but you have a driver problem, and it cannot load the needed dlls, so it uses CPU only. You have to resolve this issue before you can use the GPU.

1 Like

which part is different? they look mostly identical to me, not sure if i’m missing something

we’re looking into it and will let you know when there’s a fix, might not be today though

@akelad If there is a patch, I would still like to try it.

@petasis

@Tobias_Wochinger Here it is:

The event order is for some reason wrong. The flight_departure_form should come before the slot events. I just tried this out myself and the order is definitely correct. How does your domain look like and which versions of Rasa Open Source and the Rasa SDK are you using?

the form slots that should be filled according to the domain file, were filled before a form validation was requested. In rasa 2.0, the form slots are empty. And when validation is asked from the action server, now the slot filling has to somehow happen in the actions server.

The slots should still be filled based on the slot mappings before the request is sent to the SDK. The SDK can 1) validate the extracted slots 2) Add new slot events (e.g. for custom slot mappings)

I am using rasa/sdk 2.0. In rasa 2.0.0rc4 I had a workarround. In rasa 2.0 I don’t know what to do. The domain is included in the archive.

When you mention the “The flight_departure_form should come before the slot events”, in which file you are referring to? Can you send me a “corrected” story? (I generated the stories with rasa interactive).

rasa --version
Rasa Version     : 2.0.0
Rasa SDK Version : 2.0.0
Rasa X Version   : None
Python Version   : 3.8.5 (default, Aug 12 2020, 00:00:00) 
Operating System : Linux-5.8.12-200.fc32.x86_64-x86_64-with-glibc2.2.5
Python Path      : /usr/bin/python3

Regarding running the form, no, no form slots are filled before calling the form activation/validation.

That part should be done within Rasa Open Source so you don’t require a story for that.

The domain is included in the archive.

Sorry, but where can I find this archive? :see_no_evil:

Has Rasa X been updated to work with Rasa 2.0? I don’t see a new tag in docker hub: Docker Hub

Hi @tatianaf, thanks for asking! We’ll release a compatible version end of this week / early next week :+1:

I have created a small example, uploaded here: Rasa 2.0: How to resolve conflicting rules?

Some observations from the upgrade to Rasa 2.0.

Rasa 2.0 installs tensorflow 2.3.1. which has specific environment requirements before it can utilize a GPU. Requirements listed here:

For reference my working environment is:

  • GPU: GeForce GTX1070 (must be an approved GPU. see CUDA GPUs | NVIDIA Developer)
  • GPU driver - 456.38 (latest will probably work)
  • CUDA toolkit - 10.1.243 (must be 10.1 version)
  • cuDNN - 7.6.5 (must be 7.6 version)

It is possible to make TF work with other version combinations but this will require a recompile of the toolkit.

When a new version with working forms will be released? It was been a week since the release of 2.0.

1 Like

Facing almost the same problem :confused: . Slots gets extracted but does not get validated using validate_<slot_name> function.

@petasis are you able to validate the slot filled when asked explicitly rather than in the trigger message? if yes can you share how did you do that. Thanks

Yes, I know :slight_smile: It makes rasa 2.0 unusable, doesn’t it? It is surprising that it got released in the first place, and that a week without a fix has passed.

Yes totally agree, Form is an important feature. Also i was checking their implementation. required_slots and validate functions are still there then why are they providing a new interface. I was overriding validate before, without any issue :confused: . I am also stucked :confused:

Yes, I think this is working. The problem is when the value to fill the slot is in the trigger message. I haven’t done anything special, I just followed the docs here:

(If you had your actions working according to 2.0.0rc4, you need to change them again).

1 Like

@noman you’re right that those functions still exist (they just read from different sources now), the idea behind moving e.g. the required_slots definition to the domain is to make it simpler to define a form - i.e. less code. And aside from that moving the logic of the FormAction to Rasa Open Source, means that creating action servers in different languages is a lot easier. You can also hear more about this in our 2.0 webinar today

@akelad so can we override validate even now? if yes, then why i should not override it? because current guidelines here Forms does not validate filled slots having logs

`2020-10-14 17:06:20 DEBUG rasa.core.processor - Logged UserUtterance - tracker now has 297 events. 2020-10-14 17:06:20 DEBUG rasa.core.policies.rule_policy - Predicted loop ‘order_form’. 2020-10-14 17:06:20 DEBUG rasa.core.policies.ensemble - Predicted next action using policy_0_RulePolicy 2020-10-14 17:06:20 DEBUG rasa.core.processor - Predicted next action ‘order_form’ with confidence 1.00. 2020-10-14 17:06:20 DEBUG rasa.core.actions.forms - Validating user input ‘UserUttered(text: lays, intent: {‘id’: 3152659454284902011, ‘name’: ‘inform’, ‘confidence’: 0.999991774559021}, entities: [{‘entity’: ‘snack’, ‘start’: 0, ‘end’: 4, ‘confidence_entity’: 0.8661425709724426, ‘value’: ‘lays’, ‘extractor’: ‘DIETClassifier’}])’. 2020-10-14 17:06:20 DEBUG rasa.core.actions.forms - Trying to extract requested slot ‘snack’ … 2020-10-14 17:06:20 DEBUG rasa.core.actions.forms - Got mapping ‘{‘type’: ‘from_entity’, ‘entity’: ‘snack’}’ 2020-10-14 17:06:20 DEBUG rasa.core.actions.forms - Successfully extracted ‘lays’ for requested slot ‘snack’ 2020-10-14 17:06:20 DEBUG rasa.core.actions.forms - Validating extracted slots: {‘snack’: ‘lays’} 2020-10-14 17:06:20 DEBUG rasa.core.actions.action - Calling action endpoint to run action ‘validate_order_form’. 2020-10-14 17:06:20 DEBUG rasa.core.actions.forms - Request next slot ‘size’

and My custom action: from typing import Dict, Text, List

from rasa_sdk import Tracker from rasa_sdk.events import EventType from rasa_sdk.executor import CollectingDispatcher from rasa_sdk import Action from rasa_sdk.events import SlotSet from typing import Text, List, Any, Dict from rasa_sdk import Tracker, FormValidationAction from rasa_sdk.types import DomainDict from rasa.shared.core.domain import Domain

class ActionSwitchFAQ(Action): def name(self) -> Text: return “action_switch_faq”

def run(
    self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict
) -> List[EventType]:
    return [SlotSet("detailed_faq", not tracker.get_slot("detailed_faq"))]

class ValidateOrderForm(FormValidationAction, Action): def name(self) -> Text: “”“Unique identifier of the form”""

    return "validate_order_form"

def run(
    self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict
) -> List[EventType]:
    # dispatcher.utter_message("validate_some_slot")
    return []

def validate_snack(
    self,
    slot_value: Any,
    dispatcher: CollectingDispatcher,
    tracker: Tracker,
    domain: DomainDict,
) -> Dict[Text, Any]:
    """Validate cuisine value."""
    
    print("Slot Value=", slot_value)
    if slot_value == "fries":
        print("validation succeeded")
        return {"snack": slot_value}
    else:
        print("validation failed")
        # user will be asked for the slot again
        return {"snack": None}

def validate_size(
    self,
    slot_value: Any,
    dispatcher: CollectingDispatcher,
    tracker: Tracker,
    domain: DomainDict,
) -> Dict[Text, Any]:
    """Validate cuisine value."""
    
    print("Slot Value=", slot_value)
    if slot_value == "large":
        print("validation succeeded")
        return {"size": slot_value}
    else:
        print("validation failed")
        # user will be asked for the slot again
        return {"size": None}   

`