OSError: [Errno 36] File name too long

#7
by spoilvoid - opened

I want to chat with Qwen with several turns. But when inputting history with query longer than 255, I get OS error below.
屏幕截图 2024-05-19 155531.jpg
It seems that it's a bug with gradio, what should I do to solve the problem?

Qwen org

how are you attempting to run this..? it looks like it's trying to make your entire prompt a file name..

I just try to run code given by API recorder.

from gradio_client import Client, file

client = Client("Qwen/Qwen1.5-110B-Chat-demo")

client.predict(
  system="Suppose you are a person in a virtual world. You need to complete a task. The first query will provide the game background information and your task. You need not to answer the first query. In following turns, the query provides the environment response and admissible actions. In order to solve the task, you need to output an admissible action every turn until you complete the task.\nYou are in the middle of a room. Looking quickly around you, you see a armchair 1, a cabinet 4, a cabinet 3, a cabinet 2, a cabinet 1, a drawer 5, a drawer 4, a drawer 3, a drawer 2, a drawer 1, a dresser 1, a garbagecan 1, a safe 1, a shelf 12, a shelf 11, a shelf 10, a shelf 9, a shelf 8, a shelf 7, a shelf 6, a shelf 5, a shelf 4, a shelf 3, a shelf 2, a shelf 1, a sidetable 1, and a sofa 1.\nYour task is to: put a vase in safe.",
  api_name="/modify_system_session"
)

client.predict(
  query="Recorded action and response history:\nYour next possible actions are: go to armchair 1, go to cabinet 1, go to cabinet 2, go to cabinet 3, go to cabinet 4, go to drawer 1, go to drawer 2, go to drawer 3, go to drawer 4, go to drawer 5, go to dresser 1, go to garbagecan 1, go to safe 1, go to shelf 1, go to shelf 10, go to shelf 11, go to shelf 12, go to shelf 2, go to shelf 3, go to shelf 4, go to shelf 5, go to shelf 6, go to shelf 7, go to shelf 8, go to shelf 9, go to sidetable 1, go to sofa 1, inventory and look.\nWhat should you do next?",
  history=[],
  system="Suppose you are a person in a virtual world. You need to complete a task. The first query will provide the game background information and your task. You need not to answer the first query. In following turns, the query provides the environment response and admissible actions. In order to solve the task, you need to output an admissible action every turn until you complete the task.\nYou are in the middle of a room. Looking quickly around you, you see a armchair 1, a cabinet 4, a cabinet 3, a cabinet 2, a cabinet 1, a drawer 5, a drawer 4, a drawer 3, a drawer 2, a drawer 1, a dresser 1, a garbagecan 1, a safe 1, a shelf 12, a shelf 11, a shelf 10, a shelf 9, a shelf 8, a shelf 7, a shelf 6, a shelf 5, a shelf 4, a shelf 3, a shelf 2, a shelf 1, a sidetable 1, and a sofa 1.\nYour task is to: put a vase in safe.",
  api_name="/model_chat"
)

client.predict(
  query="Action: go to shelf 1. Result: You arrive at loc 25. On the shelf 1, you see nothing.\nYour next possible actions are: examine shelf 1, go to armchair 1, go to cabinet 1, go to cabinet 2, go to cabinet 3, go to cabinet 4, go to drawer 1, go to drawer 2, go to drawer 3, go to drawer 4, go to drawer 5, go to dresser 1, go to garbagecan 1, go to safe 1, go to shelf 10, go to shelf 11, go to shelf 12, go to shelf 2, go to shelf 3, go to shelf 4, go to shelf 5, go to shelf 6, go to shelf 7, go to shelf 8, go to shelf 9, go to sidetable 1, go to sofa 1, inventory and look.\nWhat should you do next?",
  history=[["Recorded action and response history:\\nYour next possible actions are: go to armchair 1, go to cabinet 1, go to cabinet 2, go to cabinet 3, go to cabinet 4, go to drawer 1, go to drawer 2, go to drawer 3, go to drawer 4, go to drawer 5, go to dresser 1, go to garbagecan 1, go to safe 1, go to shelf 1, go to shelf 10, go to shelf 11, go to shelf 12, go to shelf 2, go to shelf 3, go to shelf 4, go to shelf 5, go to shelf 6, go to shelf 7, go to shelf 8, go to shelf 9, go to sidetable 1, go to sofa 1, inventory and look.\\nWhat should you do next?","go to shelf 1"]],
  system="Suppose you are a person in a virtual world. You need to complete a task. The first query will provide the game background information and your task. You need not to answer the first query. In following turns, the query provides the environment response and admissible actions. In order to solve the task, you need to output an admissible action every turn until you complete the task.\nYou are in the middle of a room. Looking quickly around you, you see a armchair 1, a cabinet 4, a cabinet 3, a cabinet 2, a cabinet 1, a drawer 5, a drawer 4, a drawer 3, a drawer 2, a drawer 1, a dresser 1, a garbagecan 1, a safe 1, a shelf 12, a shelf 11, a shelf 10, a shelf 9, a shelf 8, a shelf 7, a shelf 6, a shelf 5, a shelf 4, a shelf 3, a shelf 2, a shelf 1, a sidetable 1, and a sofa 1.\nYour task is to: put a vase in safe.",
  api_name="/model_chat"
)

The third API request will get the above error.
It works well when typing in web page. But I cannot run this code.

how are you attempting to run this..? it looks like it's trying to make your entire prompt a file name..

Can you reproduce this issue in your own conda environment? Or It's just my conda environment‘s problem?

it seems a problem with Linux, as I succeed to run above code in Windows

can it be made to work in Linux?

how are you attempting to run this..? it looks like it's trying to make your entire prompt a file name..

I am trying the same. Can we get an example please

client.predict(
query="Continue the story",
history=[["story1.txt",]],
system="You are a helpful assistant.",
api_name="/model_chat"
)

Sign up or log in to comment